diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/WebSocketClientTest.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/WebSocketClientTest.java index 5716c06a538c..7ad16d31cf3c 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/WebSocketClientTest.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/WebSocketClientTest.java @@ -53,6 +53,8 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -120,21 +122,23 @@ public void stopServer() throws Exception server.stop(); } - @Test - public void testCustomizeExecutorDirectly() throws Exception + @ParameterizedTest + @ValueSource(booleans = {false, true}) + public void testCustomizeExecutorDirectly(boolean startHttpClient) throws Exception { Executor executor = Executors.newFixedThreadPool(50); HttpClient httpClient = new HttpClient(); httpClient.setExecutor(executor); try { - httpClient.start(); + if (startHttpClient) + httpClient.start(); WebSocketClient webSocketClient = new WebSocketClient(httpClient); try { webSocketClient.start(); - Executor inuseExecutor = webSocketClient.getExecutor(); - assertSame(executor, inuseExecutor); + Executor wsExecutor = webSocketClient.getExecutor(); + assertSame(executor, wsExecutor); } finally {