From f9353618ce6dab8c35377224fc6f3ecec32ba88e Mon Sep 17 00:00:00 2001 From: Martin Polden Date: Fri, 12 Apr 2024 12:29:42 +0200 Subject: Revert to Arrays.asList --- http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java | 3 ++- .../src/test/java/ai/vespa/hosted/client/ApacheHttpClientTest.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'http-client') diff --git a/http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java b/http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java index 173387b8fc3..c17ae63fda2 100644 --- a/http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java +++ b/http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java @@ -22,6 +22,7 @@ import java.io.UncheckedIOException; import java.net.URI; import java.time.Duration; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.function.Function; @@ -90,7 +91,7 @@ public interface HttpClient extends Closeable { /** Sets the parameter key/values for the request. Number of arguments must be even. Null values are omitted. */ default RequestBuilder parameters(String... pairs) { - return parameters(List.of(pairs)); + return parameters(Arrays.asList(pairs)); } /** Sets the parameter key/values for the request. Number of arguments must be even. Pairs with {@code null} values are omitted. */ diff --git a/http-client/src/test/java/ai/vespa/hosted/client/ApacheHttpClientTest.java b/http-client/src/test/java/ai/vespa/hosted/client/ApacheHttpClientTest.java index a80d80bb248..69e7ab6f744 100644 --- a/http-client/src/test/java/ai/vespa/hosted/client/ApacheHttpClientTest.java +++ b/http-client/src/test/java/ai/vespa/hosted/client/ApacheHttpClientTest.java @@ -60,7 +60,7 @@ class ApacheHttpClientTest { URI.create("http://localhost:" + server.port() + "/"))), Method.GET) .at("root") - .parameters("query", "foo") + .parameters("query", "foo", null, null) .discard()); server.verify(2, getRequestedFor(urlEqualTo("/root?query=foo"))); server.verify(2, anyRequestedFor(anyUrl())); -- cgit v1.2.3