File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/test/java/io/vertx/tests Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 11package io .vertx .tests ;
22
33import io .vertx .core .buffer .Buffer ;
4+ import io .vertx .core .http .WebSocketClient ;
45import io .vertx .core .net .SocketAddress ;
56import io .vertx .ext .unit .Async ;
67import io .vertx .ext .unit .TestContext ;
@@ -26,11 +27,12 @@ public void testWsWithCache(TestContext ctx) {
2627 });
2728 });
2829 startProxy (backend );
29- vertx .createWebSocketClient ().connect (8080 , "localhost" , "/" ).onComplete (ctx .asyncAssertSuccess (ws1 -> {
30+ WebSocketClient client = vertx .createWebSocketClient ();
31+ client .connect (8080 , "localhost" , "/" ).onComplete (ctx .asyncAssertSuccess (ws1 -> {
3032 ws1 .handler (buffer -> {
3133 ctx .assertEquals (buffer .toString (), "v1" );
3234 ws1 .close ().onComplete (ctx .asyncAssertSuccess (v -> {
33- vertx . createWebSocketClient () .connect (8080 , "localhost" , "/" ).onComplete (ctx .asyncAssertSuccess (ws2 -> {
35+ client .connect (8080 , "localhost" , "/" ).onComplete (ctx .asyncAssertSuccess (ws2 -> {
3436 ws2 .handler (buffer2 -> {
3537 ctx .assertEquals (buffer2 .toString (), "v2" );
3638 ws2 .close ().onComplete (ctx .asyncAssertSuccess (v2 -> {
@@ -43,5 +45,6 @@ public void testWsWithCache(TestContext ctx) {
4345 });
4446 ws1 .write (Buffer .buffer ("v1" )); // first WebSocket, send and reply "v1"
4547 }));
48+ latch .awaitSuccess (20_000 );
4649 }
4750}
You can’t perform that action at this time.
0 commit comments