|
30 | 30 | import static org.hamcrest.Matchers.endsWith; |
31 | 31 | import static org.hamcrest.Matchers.equalTo; |
32 | 32 | import static org.hamcrest.Matchers.greaterThan; |
| 33 | +import static org.hamcrest.Matchers.hasItemInArray; |
33 | 34 | import static org.hamcrest.Matchers.is; |
34 | 35 | import static org.hamcrest.Matchers.oneOf; |
35 | 36 |
|
@@ -74,6 +75,9 @@ public class CrossClusterEsqlRCS1EnrichUnavailableRemotesIT extends AbstractRemo |
74 | 75 |
|
75 | 76 | private final String[] modes = { "_coordinator", "_remote" }; |
76 | 77 |
|
| 78 | + // These are the IDs used in the test data in setSourceData(). |
| 79 | + private final Integer[] employeeIDs = { 1, 2, 3, 4, 5, 6 }; |
| 80 | + |
77 | 81 | @Before |
78 | 82 | public void setupPreRequisites() throws IOException { |
79 | 83 | setupRolesAndPrivileges(); |
@@ -121,7 +125,7 @@ private void esqlEnrichWithRandomSkipUnavailable() throws Exception { |
121 | 125 | // Email |
122 | 126 | assertThat(info.apply("email was: " + value.get(0)), (String) value.get(0), endsWith("@corp.co")); |
123 | 127 | // ID |
124 | | - assertThat(info.apply("id"), value.get(1), is(i + 1)); |
| 128 | + assertThat(info.apply("id"), employeeIDs, hasItemInArray((int) value.get(1))); |
125 | 129 | } |
126 | 130 |
|
127 | 131 | assertThat(info.apply("total clusters"), (int) clusters.get("total"), is(2)); |
@@ -170,7 +174,7 @@ private void esqlEnrichWithSkipUnavailableTrue() throws Exception { |
170 | 174 | // Email |
171 | 175 | assertThat(info.apply("email was: " + value.get(0)), (String) value.get(0), endsWith("@corp.co")); |
172 | 176 | // ID |
173 | | - assertThat(info.apply("id"), value.get(1), is(i + 1)); |
| 177 | + assertThat(info.apply("id"), employeeIDs, hasItemInArray((int) value.get(1))); |
174 | 178 | } |
175 | 179 |
|
176 | 180 | assertThat(info.apply("total clusters"), (int) clusters.get("total"), is(2)); |
|
0 commit comments