aboutsummaryrefslogtreecommitdiffstats
path: root/http-client
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2024-04-12 12:29:42 +0200
committerMartin Polden <mpolden@mpolden.no>2024-04-12 12:29:42 +0200
commitf9353618ce6dab8c35377224fc6f3ecec32ba88e (patch)
tree63ce3b311f7eb29ef01c10e9e39d05d755e7e12d /http-client
parent322759812e53cb7cdc7d4f6faa5439bcc7d0eb34 (diff)
Revert to Arrays.asList
Diffstat (limited to 'http-client')
-rw-r--r--http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java3
-rw-r--r--http-client/src/test/java/ai/vespa/hosted/client/ApacheHttpClientTest.java2
2 files changed, 3 insertions, 2 deletions
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()));