Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kfuksman committed May 24, 2019
1 parent 4db1b2b commit b58cf6e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Expand Up @@ -939,9 +939,7 @@ Params withIndicesOptions(IndicesOptions indicesOptions) {
expandWildcards = joiner.toString();
}
putParam("expand_wildcards", expandWildcards);
if(!indicesOptions.ignoreThrottled()){
putParam("ignore_throttled", "false")
}
putParam("ignore_throttled", Boolean.toString(indicesOptions.ignoreThrottled()));
}
return this;
}
Expand Down
Expand Up @@ -1561,7 +1561,7 @@ public void testFieldCaps() {
endpoint.add("_field_caps");

assertEquals(endpoint.toString(), request.getEndpoint());
assertEquals(4, request.getParameters().size());
assertEquals(5, request.getParameters().size());

// Note that we don't check the field param value explicitly, as field names are
// passed through
Expand Down Expand Up @@ -1595,7 +1595,7 @@ public void testRankEval() throws Exception {
}
endpoint.add(RestRankEvalAction.ENDPOINT);
assertEquals(endpoint.toString(), request.getEndpoint());
assertEquals(3, request.getParameters().size());
assertEquals(4, request.getParameters().size());
assertEquals(expectedParams, request.getParameters());
assertToXContentBody(spec, request.getEntity());
}
Expand Down Expand Up @@ -1922,7 +1922,8 @@ static void setRandomIndicesOptions(Consumer<IndicesOptions> setter, Supplier<In
Map<String, String> expectedParams) {

if (randomBoolean()) {
setter.accept(IndicesOptions.fromOptions(randomBoolean(), randomBoolean(), randomBoolean(), randomBoolean()));
setter.accept(IndicesOptions.fromOptions(randomBoolean(), randomBoolean(), randomBoolean(), randomBoolean(),
true, false, false, randomBoolean()));
}
expectedParams.put("ignore_unavailable", Boolean.toString(getter.get().ignoreUnavailable()));
expectedParams.put("allow_no_indices", Boolean.toString(getter.get().allowNoIndices()));
Expand All @@ -1935,11 +1936,13 @@ static void setRandomIndicesOptions(Consumer<IndicesOptions> setter, Supplier<In
} else {
expectedParams.put("expand_wildcards", "none");
}
expectedParams.put("ignore_throttled", Boolean.toString(getter.get().ignoreThrottled()));
}

static IndicesOptions setRandomIndicesOptions(IndicesOptions indicesOptions, Map<String, String> expectedParams) {
if (randomBoolean()) {
indicesOptions = IndicesOptions.fromOptions(randomBoolean(), randomBoolean(), randomBoolean(), randomBoolean());
indicesOptions = IndicesOptions.fromOptions(randomBoolean(), randomBoolean(), randomBoolean(), randomBoolean(),
true, false, false, randomBoolean());
}
expectedParams.put("ignore_unavailable", Boolean.toString(indicesOptions.ignoreUnavailable()));
expectedParams.put("allow_no_indices", Boolean.toString(indicesOptions.allowNoIndices()));
Expand All @@ -1952,6 +1955,7 @@ static IndicesOptions setRandomIndicesOptions(IndicesOptions indicesOptions, Map
} else {
expectedParams.put("expand_wildcards", "none");
}
expectedParams.put("ignore_throttled", Boolean.toString(indicesOptions.ignoreThrottled()));
return indicesOptions;
}

Expand Down

0 comments on commit b58cf6e

Please sign in to comment.