|
42 | 42 | import java.util.Collections;
|
43 | 43 | import java.util.List;
|
44 | 44 | import java.util.Map;
|
45 |
| -import java.util.Set; |
46 | 45 | import java.util.concurrent.atomic.AtomicBoolean;
|
47 | 46 | import java.util.concurrent.atomic.AtomicInteger;
|
48 | 47 | import java.util.concurrent.atomic.AtomicReference;
|
49 |
| -import java.util.regex.Matcher; |
50 |
| -import java.util.regex.Pattern; |
51 | 48 | import java.util.stream.Collectors;
|
52 | 49 | import java.util.stream.Stream;
|
53 | 50 |
|
@@ -986,16 +983,7 @@ public void testAlias() throws Exception {
|
986 | 983 | Request request = esqlRequest("FROM " + index + " | KEEP emp_id | SORT emp_id | LIMIT 100");
|
987 | 984 | ResponseException error = expectThrows(ResponseException.class, () -> performRequestWithRemoteSearchUser(request));
|
988 | 985 | assertThat(error.getResponse().getStatusLine().getStatusCode(), equalTo(400));
|
989 |
| - String expectedIndexExpressionInError = index.replace("*", "my_remote_cluster"); |
990 |
| - Pattern p = Pattern.compile("Unknown index \\[([^\\]]+)\\]"); |
991 |
| - Matcher m = p.matcher(error.getMessage()); |
992 |
| - assertTrue("Pattern matcher to parse error message did not find matching string: " + error.getMessage(), m.find()); |
993 |
| - String unknownIndexExpressionInErrorMessage = m.group(1); |
994 |
| - Set<String> actualUnknownIndexes = org.elasticsearch.common.Strings.commaDelimitedListToSet( |
995 |
| - unknownIndexExpressionInErrorMessage |
996 |
| - ); |
997 |
| - Set<String> expectedUnknownIndexes = org.elasticsearch.common.Strings.commaDelimitedListToSet(expectedIndexExpressionInError); |
998 |
| - assertThat(actualUnknownIndexes, equalTo(expectedUnknownIndexes)); |
| 986 | + assertThat(error.getMessage(), containsString("Unknown index [" + index + "]")); |
999 | 987 | }
|
1000 | 988 |
|
1001 | 989 | for (var index : List.of(
|
|
0 commit comments