diff --git a/test/jdk/java/net/httpclient/http3/H3RequestRejectedTest.java b/test/jdk/java/net/httpclient/http3/H3RequestRejectedTest.java index 361a78fdd4757..1731ddae833e7 100644 --- a/test/jdk/java/net/httpclient/http3/H3RequestRejectedTest.java +++ b/test/jdk/java/net/httpclient/http3/H3RequestRejectedTest.java @@ -50,6 +50,7 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpRequest.BodyPublishers; import static java.nio.charset.StandardCharsets.US_ASCII; +import static jdk.httpclient.test.lib.common.HttpServerAdapters.createClientBuilderForH3; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -100,7 +101,7 @@ static void afterAll() throws Exception { */ @Test void testAlwaysRejected() throws Exception { - try (final HttpClient client = HttpClient.newBuilder() + try (final HttpClient client = createClientBuilderForH3() .sslContext(sslContext).proxy(NO_PROXY).version(HTTP_3) .build()) { @@ -134,7 +135,7 @@ void testAlwaysRejected() throws Exception { */ @Test void testRejectedRequest() throws Exception { - try (final HttpClient client = HttpClient.newBuilder().sslContext(sslContext) + try (final HttpClient client = createClientBuilderForH3().sslContext(sslContext) .proxy(NO_PROXY).version(HTTP_3) .build()) {