File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
server/src/test/java/org/elasticsearch/index/query Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 4141
4242import static org .elasticsearch .index .query .QueryBuilders .boolQuery ;
4343import static org .elasticsearch .index .query .QueryBuilders .termQuery ;
44+ import static org .hamcrest .CoreMatchers .containsString ;
4445import static org .hamcrest .CoreMatchers .equalTo ;
4546import static org .hamcrest .CoreMatchers .instanceOf ;
4647
@@ -291,6 +292,9 @@ public void testUnknownQueryName() throws IOException {
291292
292293 XContentParseException ex = expectThrows (XContentParseException .class , () -> parseQuery (query ));
293294 assertEquals ("[1:41] [bool] failed to parse field [must]" , ex .getMessage ());
295+ Throwable e = ex .getCause ();
296+ assertThat (e .getMessage (), containsString ("unknown query [unknown_query]" ));
297+
294298 }
295299
296300 public void testRewrite () throws IOException {
You can’t perform that action at this time.
0 commit comments