diff --git a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/extension/async/TestAsyncServer.java b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/extension/async/TestAsyncServer.java index d16916415..e75ef11b6 100644 --- a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/extension/async/TestAsyncServer.java +++ b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/extension/async/TestAsyncServer.java @@ -91,10 +91,14 @@ public void close() throws Exception { } public InetSocketAddress start() throws Exception { - if (http1Config == null) { - return server.start(httpProcessor, exchangeHandlerDecorator, h2Config); + if (http1Config != null) { + server.configure(http1Config); + } else { + server.configure(h2Config); } - return server.start(httpProcessor, exchangeHandlerDecorator, http1Config); + server.configure(exchangeHandlerDecorator); + server.configure(httpProcessor); + return server.start(); } } diff --git a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/extension/sync/TestServer.java b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/extension/sync/TestServer.java index d09e23170..039fcb7b7 100644 --- a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/extension/sync/TestServer.java +++ b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/extension/sync/TestServer.java @@ -60,7 +60,10 @@ public void shutdown(final CloseMode closeMode) { } public InetSocketAddress start() throws IOException { - server.start(http1Config, httpProcessor, exchangeHandlerDecorator); + server.configure(http1Config); + server.configure(exchangeHandlerDecorator); + server.configure(httpProcessor); + server.start(); return new InetSocketAddress(server.getInetAddress(), server.getPort()); }