|
@@ -294,10 +294,7 @@ public class NestedQueryBuilderTests extends AbstractQueryTestCase<NestedQueryBu
|
|
|
|
|
|
final NestedQueryBuilder failingQueryBuilder = new NestedQueryBuilder("unmapped", new MatchAllQueryBuilder(), ScoreMode.None);
|
|
|
failingQueryBuilder.ignoreUnmapped(false);
|
|
|
- IllegalStateException e = expectThrows(
|
|
|
- IllegalStateException.class,
|
|
|
- () -> failingQueryBuilder.toQuery(createSearchExecutionContext())
|
|
|
- );
|
|
|
+ QueryShardException e = expectThrows(QueryShardException.class, () -> failingQueryBuilder.toQuery(createSearchExecutionContext()));
|
|
|
assertThat(e.getMessage(), containsString("[" + NestedQueryBuilder.NAME + "] failed to find nested object under path [unmapped]"));
|
|
|
}
|
|
|
|