|
11 | 11 | import org.elasticsearch.client.internal.Client; |
12 | 12 | import org.elasticsearch.common.Strings; |
13 | 13 | import org.elasticsearch.common.settings.Settings; |
| 14 | +import org.elasticsearch.index.IndexNotFoundException; |
14 | 15 | import org.elasticsearch.index.query.QueryBuilder; |
15 | 16 | import org.elasticsearch.index.query.RangeQueryBuilder; |
16 | 17 | import org.elasticsearch.test.transport.MockTransportService; |
@@ -275,13 +276,13 @@ public void testFilterWithMissingIndex() { |
275 | 276 | ); |
276 | 277 | assertThat(e.getDetailedMessage(), containsString("Unknown index [missing]")); |
277 | 278 | // Local index missing + wildcards |
278 | | - // FIXME: planner does not catch this now |
279 | | - // e = expectThrows(VerificationException.class, () -> runQuery("from missing,logs*", randomBoolean(), filter).close()); |
280 | | - // assertThat(e.getDetailedMessage(), containsString("Unknown index [missing]")); |
| 279 | + // FIXME: planner does not catch this now, it should be VerificationException but for now it's runtime IndexNotFoundException |
| 280 | + var ie = expectThrows(IndexNotFoundException.class, () -> runQuery("from missing,logs*", randomBoolean(), filter).close()); |
| 281 | + assertThat(ie.getDetailedMessage(), containsString("no such index [missing]")); |
281 | 282 | // Local index missing + existing index |
282 | | - // FIXME: planner does not catch this now |
283 | | - // e = expectThrows(VerificationException.class, () -> runQuery("from missing,logs-1", randomBoolean(), filter).close()); |
284 | | - // assertThat(e.getDetailedMessage(), containsString("Unknown index [missing]")); |
| 283 | + // FIXME: planner does not catch this now, it should be VerificationException but for now it's runtime IndexNotFoundException |
| 284 | + ie = expectThrows(IndexNotFoundException.class, () -> runQuery("from missing,logs-1", randomBoolean(), filter).close()); |
| 285 | + assertThat(ie.getDetailedMessage(), containsString("no such index [missing]")); |
285 | 286 | // Local index missing + existing remote |
286 | 287 | e = expectThrows(VerificationException.class, () -> runQuery("from missing,cluster-a:logs-2", randomBoolean(), filter).close()); |
287 | 288 | assertThat(e.getDetailedMessage(), containsString("Unknown index [missing]")); |
|
0 commit comments