From 12409713ebf05d10e00a4ad6ac32741503c43adf Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Thu, 12 Sep 2024 15:13:08 +0200 Subject: [PATCH] Replaced deprecated functionality --- .../testing/extension/async/TestAsyncServer.java | 10 +++++++--- .../hc/client5/testing/extension/sync/TestServer.java | 5 ++++- 2 files changed, 11 insertions(+), 4 deletions(-) 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 class TestAsyncServer { } 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 class TestServer { } 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()); }