Skip to content

Commit

Permalink
Replace forbidden API call in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
afoucret committed May 27, 2024
1 parent 460aeba commit 1e2d50d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.support.XContentMapValues;
import org.junit.Before;
Expand Down Expand Up @@ -272,14 +273,14 @@ public void testLearningToRankRescorerWithChainedRescorers() throws IOException

{
Request request = new Request("GET", "store/_search?size=4");
request.setJsonEntity(String.format(queryTemplate, randomIntBetween(2, 10000), randomIntBetween(4, 5)));
request.setJsonEntity(Strings.format(queryTemplate, randomIntBetween(2, 10000), randomIntBetween(4, 5)));
assertHitScores(client().performRequest(request), List.of(40.0, 40.0, 37.0, 29.0));
}

{
int lastRescorerWindowSize = randomIntBetween(6, 10000);
Request request = new Request("GET", "store/_search?size=4");
request.setJsonEntity(String.format(queryTemplate, randomIntBetween(2, 10000), lastRescorerWindowSize));
request.setJsonEntity(Strings.format(queryTemplate, randomIntBetween(2, 10000), lastRescorerWindowSize));

Exception e = assertThrows(ResponseException.class, () -> client().performRequest(request));
assertThat(
Expand Down

0 comments on commit 1e2d50d

Please sign in to comment.