Skip to content

Commit

Permalink
fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-schel committed Jun 27, 2023
1 parent ec92eb6 commit dee8d21
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ public static void initTestEnvironment() {
void testRegisterSmartObjectViaWebsocketInterfaceAndVerifyViaSmartObjectMgmtRest() throws Exception {
LOG.info("start test register SmartObject via WebsocketInterface and verify via SmartObjectMgmtRest");
// Setup self-description for a smart object.
TestClient4Websocket testClient = new TestClient4Websocket(testEnv.getUrlInterfaceWebSocket(), UUID.randomUUID().toString());
ResponseEntity<ObjectNode> token = testEnv.getNewToken(testEnv.getOwnerUuid());
assertTrue(token.hasBody(), "get token has no response body");
TestClient4Websocket testClient = new TestClient4Websocket(testEnv.getUrlInterfaceWebSocket(), token.getBody().get("token").asText());
// Start the client - it connects to the WebSocket interface.
CountDownLatch registered = new CountDownLatch(1);
testClient.startClient(registered);
Expand All @@ -86,7 +88,7 @@ void testRegisterSmartObjectViaWebsocketInterfaceAndVerifyViaSmartObjectMgmtRest
assertNotNull(returnedSelfDescription, "returned self-description is null");
assertEquals(testClient.getName(), returnedSelfDescription.get("name").asText(), "returned self-description name not equals");
assertEquals(testClient.getUuid(), returnedSelfDescription.get("uuid").asText(), "returned self-description uuid not equals");
assertEquals("REGISTRATED", returnedSelfDescription.get("lifecycleState").asText(), "returned self-description lifecycle state is not registered");
assertEquals("VERIFIED", returnedSelfDescription.get("lifecycleState").asText(), "returned self-description lifecycle state is not registered");

// Remove our client from the MSB.
CountDownLatch closed = new CountDownLatch(1);
Expand Down

0 comments on commit dee8d21

Please sign in to comment.