From dee8d2178863ebf1c2bd99a47fdc7afd02adf793 Mon Sep 17 00:00:00 2001 From: des Date: Tue, 27 Jun 2023 12:10:37 +0200 Subject: [PATCH] fix integration test --- .../msb/client/websocket/test/system/MsbWebSocketIT.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/msb-client-websocket/src/test/java/de/fhg/ipa/vfk/msb/client/websocket/test/system/MsbWebSocketIT.java b/msb-client-websocket/src/test/java/de/fhg/ipa/vfk/msb/client/websocket/test/system/MsbWebSocketIT.java index 9d0acf1..de3b5e6 100644 --- a/msb-client-websocket/src/test/java/de/fhg/ipa/vfk/msb/client/websocket/test/system/MsbWebSocketIT.java +++ b/msb-client-websocket/src/test/java/de/fhg/ipa/vfk/msb/client/websocket/test/system/MsbWebSocketIT.java @@ -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 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); @@ -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);