Skip to content

Commit 2ec51ff

Browse files
committed
update test
1 parent 59470c7 commit 2ec51ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/test/java/org/elasticsearch/index/query/functionscore/FunctionScoreTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ public void testWithInvalidScores() {
944944
null,
945945
Float.POSITIVE_INFINITY
946946
);
947-
ElasticsearchException exc = expectThrows(ElasticsearchException.class, () -> localSearcher.search(query1, 1));
947+
IllegalArgumentException exc = expectThrows(IllegalArgumentException.class, () -> localSearcher.search(query1, 1));
948948
assertThat(exc.getMessage(), containsString("function score query returned an invalid score: " + Float.NaN));
949949
FunctionScoreQuery query2 = new FunctionScoreQuery(
950950
new TermQuery(new Term(FIELD, "out")),
@@ -953,7 +953,7 @@ public void testWithInvalidScores() {
953953
null,
954954
Float.POSITIVE_INFINITY
955955
);
956-
exc = expectThrows(ElasticsearchException.class, () -> localSearcher.search(query2, 1));
956+
exc = expectThrows(IllegalArgumentException.class, () -> localSearcher.search(query2, 1));
957957
assertThat(exc.getMessage(), containsString("function score query returned an invalid score: " + Float.NEGATIVE_INFINITY));
958958
}
959959

0 commit comments

Comments
 (0)