summaryrefslogtreecommitdiffstats
path: root/http-utils
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-01-04 07:59:31 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2023-01-25 10:48:38 +0100
commitdd05e4b94d67b481c241cfa20ccf0e481dcb0bd7 (patch)
treed48af28cb2c6651f6a7424d599dfeb1610b8c931 /http-utils
parentdb01dd9ebc4f63acc71d4ef9b015db4133a5de6d (diff)
Bump apache httpclient from 5.1 to 5.2.
Diffstat (limited to 'http-utils')
-rw-r--r--http-utils/src/main/java/ai/vespa/util/http/hc5/HttpToHttpsRoutePlanner.java4
-rw-r--r--http-utils/src/test/java/ai/vespa/util/http/hc5/HttpToHttpsRoutePlannerTest.java10
2 files changed, 7 insertions, 7 deletions
diff --git a/http-utils/src/main/java/ai/vespa/util/http/hc5/HttpToHttpsRoutePlanner.java b/http-utils/src/main/java/ai/vespa/util/http/hc5/HttpToHttpsRoutePlanner.java
index 962e6b32947..8275098cb8d 100644
--- a/http-utils/src/main/java/ai/vespa/util/http/hc5/HttpToHttpsRoutePlanner.java
+++ b/http-utils/src/main/java/ai/vespa/util/http/hc5/HttpToHttpsRoutePlanner.java
@@ -4,7 +4,6 @@ package ai.vespa.util.http.hc5;
import org.apache.hc.client5.http.HttpRoute;
import org.apache.hc.client5.http.protocol.HttpClientContext;
import org.apache.hc.client5.http.routing.HttpRoutePlanner;
-import org.apache.hc.core5.http.HttpException;
import org.apache.hc.core5.http.HttpHost;
import org.apache.hc.core5.http.protocol.HttpContext;
@@ -16,8 +15,9 @@ import org.apache.hc.core5.http.protocol.HttpContext;
*/
class HttpToHttpsRoutePlanner implements HttpRoutePlanner {
+ @SuppressWarnings("deprecation")
@Override
- public HttpRoute determineRoute(HttpHost target, HttpContext context) throws HttpException {
+ public HttpRoute determineRoute(HttpHost target, HttpContext context) {
if ( ! target.getSchemeName().equals("http") && ! target.getSchemeName().equals("https"))
throw new IllegalArgumentException("Scheme must be 'http' or 'https' when using HttpToHttpsRoutePlanner, was '" + target.getSchemeName() + "'");
diff --git a/http-utils/src/test/java/ai/vespa/util/http/hc5/HttpToHttpsRoutePlannerTest.java b/http-utils/src/test/java/ai/vespa/util/http/hc5/HttpToHttpsRoutePlannerTest.java
index b20d801e39c..9f56f7ebc09 100644
--- a/http-utils/src/test/java/ai/vespa/util/http/hc5/HttpToHttpsRoutePlannerTest.java
+++ b/http-utils/src/test/java/ai/vespa/util/http/hc5/HttpToHttpsRoutePlannerTest.java
@@ -4,7 +4,6 @@ package ai.vespa.util.http.hc5;
import org.apache.hc.client5.http.HttpRoute;
import org.apache.hc.client5.http.config.RequestConfig;
import org.apache.hc.client5.http.protocol.HttpClientContext;
-import org.apache.hc.core5.http.HttpException;
import org.apache.hc.core5.http.HttpHost;
import org.junit.jupiter.api.Test;
@@ -18,7 +17,7 @@ public class HttpToHttpsRoutePlannerTest {
final HttpToHttpsRoutePlanner planner = new HttpToHttpsRoutePlanner();
@Test
- void verifySchemeMustBeHttp() throws HttpException {
+ void verifySchemeMustBeHttp() {
try {
planner.determineRoute(new HttpHost("https", "host", 1), new HttpClientContext());
}
@@ -28,7 +27,7 @@ public class HttpToHttpsRoutePlannerTest {
}
@Test
- void verifyPortMustBeSet() throws HttpException {
+ void verifyPortMustBeSet() {
try {
planner.determineRoute(new HttpHost("http", "host", -1), new HttpClientContext());
}
@@ -39,7 +38,8 @@ public class HttpToHttpsRoutePlannerTest {
@Test
- void verifyProxyIsDisallowed() throws HttpException {
+ @SuppressWarnings("deprecation")
+ void verifyProxyIsDisallowed() {
HttpClientContext context = new HttpClientContext();
context.setRequestConfig(RequestConfig.custom().setProxy(new HttpHost("proxy")).build());
try {
@@ -51,7 +51,7 @@ public class HttpToHttpsRoutePlannerTest {
}
@Test
- void verifySchemeIsRewritten() throws HttpException {
+ void verifySchemeIsRewritten() {
assertEquals(new HttpRoute(new HttpHost("https", "host", 1)),
planner.determineRoute(new HttpHost("http", "host", 1), new HttpClientContext()));
}