diff --git a/java-client/src/main/java/org/opensearch/client/util/PathEncoder.java b/java-client/src/main/java/org/opensearch/client/util/PathEncoder.java index c9345a003f..b10d8955b2 100644 --- a/java-client/src/main/java/org/opensearch/client/util/PathEncoder.java +++ b/java-client/src/main/java/org/opensearch/client/util/PathEncoder.java @@ -31,7 +31,11 @@ public class PathEncoder { static { Class clazz = null; try { +<<<<<<< Updated upstream // Try Apache HttpClient5 first since this is a default one +======= + // Try Apache HttpClient5 first since this is the "better" encoder +>>>>>>> Stashed changes clazz = Class.forName(HTTP_CLIENT5_UTILS_CLASS); } catch (final ClassNotFoundException ex) { try { diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/model/EndpointTest.java b/java-client/src/test/java/org/opensearch/client/opensearch/model/EndpointTest.java index b37f98622a..5f6d05c59d 100644 --- a/java-client/src/test/java/org/opensearch/client/opensearch/model/EndpointTest.java +++ b/java-client/src/test/java/org/opensearch/client/opensearch/model/EndpointTest.java @@ -57,6 +57,7 @@ public void testArrayPathParameter() { assertEquals("/a/_refresh", RefreshRequest._ENDPOINT.requestUrl(req)); req = RefreshRequest.of(b -> b.index("a", "b")); +<<<<<<< Updated upstream if (isHttpClient5Present()) { assertEquals("/a%2Cb/_refresh", RefreshRequest._ENDPOINT.requestUrl(req)); @@ -70,6 +71,12 @@ public void testArrayPathParameter() { } else { assertEquals("/a,b,c/_refresh", RefreshRequest._ENDPOINT.requestUrl(req)); } +======= + assertEquals("/a%2Cb/_refresh", RefreshRequest._ENDPOINT.requestUrl(req)); + + req = RefreshRequest.of(b -> b.index("a", "b", "c")); + assertEquals("/a%2Cb%2Cc/_refresh", RefreshRequest._ENDPOINT.requestUrl(req)); +>>>>>>> Stashed changes } @Test @@ -80,11 +87,15 @@ public void testPathEncoding() { assertEquals("/a%2Fb/_refresh", RefreshRequest._ENDPOINT.requestUrl(req)); req = RefreshRequest.of(b -> b.index("a/b", "c/d")); +<<<<<<< Updated upstream if (isHttpClient5Present()) { assertEquals("/a%2Fb%2Cc%2Fd/_refresh", RefreshRequest._ENDPOINT.requestUrl(req)); } else { assertEquals("/a%2Fb,c%2Fd/_refresh", RefreshRequest._ENDPOINT.requestUrl(req)); } +======= + assertEquals("/a%2Fb%2Cc%2Fd/_refresh", RefreshRequest._ENDPOINT.requestUrl(req)); +>>>>>>> Stashed changes }