Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

13776: allow adding query parameters to RequestOptions #13777

Merged
merged 9 commits into from
May 31, 2024
Prev Previous commit
Next Next commit
Fix bug highlighted by unit testing
Signed-off-by: Oliver Lockwood <oliver.lockwood@cantab.net>
  • Loading branch information
oliverlockwood committed May 22, 2024
commit 1028b6b94c0d34beeb7e96a25207b3a785a36b23
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@
}
if (queryParams.size() > 0) {
reta marked this conversation as resolved.
Show resolved Hide resolved
if (comma) b.append(", ");
comma = true;
b.append("queryParams=");
oliverlockwood marked this conversation as resolved.
Show resolved Hide resolved
b.append(queryParams.entrySet().stream().map(e -> e.getKey() + "=" + e.getValue()).collect(Collectors.joining(",")));

Check warning on line 162 in client/rest/src/main/java/org/opensearch/client/RequestOptions.java

View check run for this annotation

Codecov / codecov/patch

client/rest/src/main/java/org/opensearch/client/RequestOptions.java#L160-L162

Added lines #L160 - L162 were not covered by tests
}
if (httpAsyncResponseConsumerFactory != HttpAsyncResponseConsumerFactory.DEFAULT) {
if (comma) b.append(", ");
Expand Down Expand Up @@ -222,7 +222,7 @@
RequestConfig requestConfig
) {
this.headers = new ArrayList<>(headers);
this.queryParams = new HashMap<>();
this.queryParams = new HashMap<>(queryParams);
this.httpAsyncResponseConsumerFactory = httpAsyncResponseConsumerFactory;
this.warningsHandler = warningsHandler;
this.requestConfig = requestConfig;
Expand Down
Loading