Skip to content

Commit c61e7d8

Browse files
committed
build: version bump: fix compilation error
1 parent d485763 commit c61e7d8

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

tests/src/test/java/io/jooby/i2784/Issue2784.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
package io.jooby.i2784;
77

8+
import java.time.Duration;
89
import java.util.concurrent.CountDownLatch;
910

1011
import org.asynchttpclient.Dsl;
@@ -60,16 +61,18 @@ public void onPongFrame(byte[] payload) {
6061
})
6162
.build();
6263

63-
WebSocket webSocketClient =
64-
Dsl.asyncHttpClient()
65-
.prepareGet("ws://localhost:" + http.getPort() + "/2784")
66-
.setRequestTimeout(5000)
67-
.execute(wsHandler)
68-
.get();
69-
// Send ping
70-
webSocketClient.sendPingFrame();
64+
try (var client = Dsl.asyncHttpClient()) {
65+
WebSocket webSocketClient =
66+
client
67+
.prepareGet("ws://localhost:" + http.getPort() + "/2784")
68+
.setRequestTimeout(Duration.ofSeconds(5))
69+
.execute(wsHandler)
70+
.get();
71+
// Send ping
72+
webSocketClient.sendPingFrame();
7173

72-
latch.await();
74+
latch.await();
75+
}
7376
});
7477
}
7578
}

0 commit comments

Comments
 (0)