diff --git a/extensions/websockets-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/broadcast/BroadcastOnOpenTest.java b/extensions/websockets-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/broadcast/BroadcastOnOpenTest.java index cebc41a1e7ced..e3a93cfb35250 100644 --- a/extensions/websockets-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/broadcast/BroadcastOnOpenTest.java +++ b/extensions/websockets-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/broadcast/BroadcastOnOpenTest.java @@ -64,7 +64,7 @@ public void assertBroadcast(URI testUri) throws Exception { if (r.succeeded()) { WebSocket ws = r.result(); ws.textMessageHandler(msg -> { - messages.add(msg); + messages.add(msg + ":fromC1"); if (msg.equals("c1")) { c1MessageLatch.countDown(); } else if (msg.equals("c2")) { @@ -79,7 +79,7 @@ public void assertBroadcast(URI testUri) throws Exception { }); assertTrue(c1MessageLatch.await(5, TimeUnit.SECONDS)); assertEquals(1, messages.size()); - assertEquals("c1", messages.get(0)); + assertEquals("c1:fromC1", messages.get(0)); messages.clear(); // Now connect the second client client2 @@ -88,7 +88,7 @@ public void assertBroadcast(URI testUri) throws Exception { if (r.succeeded()) { WebSocket ws = r.result(); ws.textMessageHandler(msg -> { - messages.add(msg); + messages.add(msg + ":fromC2"); c2MessageLatch.countDown(); }); } else { @@ -98,8 +98,8 @@ public void assertBroadcast(URI testUri) throws Exception { assertTrue(c2MessageLatch.await(5, TimeUnit.SECONDS), "Messages: " + messages); // onOpen should be broadcasted to both clients assertEquals(2, messages.size()); - assertEquals("c2", messages.get(0)); - assertEquals("c2", messages.get(1)); + assertEquals("c2", messages.get(0).substring(0, 2)); + assertEquals("c2", messages.get(1).substring(0, 2)); } finally { client1.close().toCompletionStage().toCompletableFuture().get(); client2.close().toCompletionStage().toCompletableFuture().get();