@@ -170,7 +170,7 @@ public void testGroupClusterIndices() throws IOException {
170
170
assertFalse (service .isRemoteClusterRegistered ("foo" ));
171
171
{
172
172
Map <String , List <String >> perClusterIndices = service .groupClusterIndices (
173
- service .getRemoteClusterNames (),
173
+ service .getRegisteredRemoteClusterNames (),
174
174
new String [] {
175
175
"cluster_1:bar" ,
176
176
"cluster_2:foo:bar" ,
@@ -191,15 +191,15 @@ public void testGroupClusterIndices() throws IOException {
191
191
expectThrows (
192
192
NoSuchRemoteClusterException .class ,
193
193
() -> service .groupClusterIndices (
194
- service .getRemoteClusterNames (),
194
+ service .getRegisteredRemoteClusterNames (),
195
195
new String [] { "foo:bar" , "cluster_1:bar" , "cluster_2:foo:bar" , "cluster_1:test" , "cluster_2:foo*" , "foo" }
196
196
)
197
197
);
198
198
199
199
expectThrows (
200
200
NoSuchRemoteClusterException .class ,
201
201
() -> service .groupClusterIndices (
202
- service .getRemoteClusterNames (),
202
+ service .getRegisteredRemoteClusterNames (),
203
203
new String [] { "cluster_1:bar" , "cluster_2:foo:bar" , "cluster_1:test" , "cluster_2:foo*" , "does_not_exist:*" }
204
204
)
205
205
);
@@ -208,7 +208,10 @@ public void testGroupClusterIndices() throws IOException {
208
208
{
209
209
String [] indices = shuffledList (List .of ("cluster*:foo*" , "foo" , "-cluster_1:*" , "*:boo" )).toArray (new String [0 ]);
210
210
211
- Map <String , List <String >> perClusterIndices = service .groupClusterIndices (service .getRemoteClusterNames (), indices );
211
+ Map <String , List <String >> perClusterIndices = service .groupClusterIndices (
212
+ service .getRegisteredRemoteClusterNames (),
213
+ indices
214
+ );
212
215
assertEquals (2 , perClusterIndices .size ());
213
216
List <String > localIndexes = perClusterIndices .get (RemoteClusterAware .LOCAL_CLUSTER_GROUP_KEY );
214
217
assertNotNull (localIndexes );
@@ -223,7 +226,10 @@ public void testGroupClusterIndices() throws IOException {
223
226
{
224
227
String [] indices = shuffledList (List .of ("*:*" , "-clu*_1:*" , "*:boo" )).toArray (new String [0 ]);
225
228
226
- Map <String , List <String >> perClusterIndices = service .groupClusterIndices (service .getRemoteClusterNames (), indices );
229
+ Map <String , List <String >> perClusterIndices = service .groupClusterIndices (
230
+ service .getRegisteredRemoteClusterNames (),
231
+ indices
232
+ );
227
233
assertEquals (1 , perClusterIndices .size ());
228
234
229
235
List <String > cluster2 = perClusterIndices .get ("cluster_2" );
@@ -236,7 +242,10 @@ public void testGroupClusterIndices() throws IOException {
236
242
new String [0 ]
237
243
);
238
244
239
- Map <String , List <String >> perClusterIndices = service .groupClusterIndices (service .getRemoteClusterNames (), indices );
245
+ Map <String , List <String >> perClusterIndices = service .groupClusterIndices (
246
+ service .getRegisteredRemoteClusterNames (),
247
+ indices
248
+ );
240
249
assertEquals (1 , perClusterIndices .size ());
241
250
List <String > localIndexes = perClusterIndices .get (RemoteClusterAware .LOCAL_CLUSTER_GROUP_KEY );
242
251
assertNotNull (localIndexes );
@@ -246,7 +255,10 @@ public void testGroupClusterIndices() throws IOException {
246
255
{
247
256
String [] indices = shuffledList (List .of ("cluster*:*" , "foo" , "-*:*" )).toArray (new String [0 ]);
248
257
249
- Map <String , List <String >> perClusterIndices = service .groupClusterIndices (service .getRemoteClusterNames (), indices );
258
+ Map <String , List <String >> perClusterIndices = service .groupClusterIndices (
259
+ service .getRegisteredRemoteClusterNames (),
260
+ indices
261
+ );
250
262
assertEquals (1 , perClusterIndices .size ());
251
263
List <String > localIndexes = perClusterIndices .get (RemoteClusterAware .LOCAL_CLUSTER_GROUP_KEY );
252
264
assertNotNull (localIndexes );
@@ -257,7 +269,7 @@ public void testGroupClusterIndices() throws IOException {
257
269
IllegalArgumentException e = expectThrows (
258
270
IllegalArgumentException .class ,
259
271
() -> service .groupClusterIndices (
260
- service .getRemoteClusterNames (),
272
+ service .getRegisteredRemoteClusterNames (),
261
273
// -cluster_1:foo* is not allowed, only -cluster_1:*
262
274
new String [] { "cluster_1:bar" , "-cluster_2:foo*" , "cluster_1:test" , "cluster_2:foo*" , "foo" }
263
275
)
@@ -271,7 +283,7 @@ public void testGroupClusterIndices() throws IOException {
271
283
IllegalArgumentException e = expectThrows (
272
284
IllegalArgumentException .class ,
273
285
() -> service .groupClusterIndices (
274
- service .getRemoteClusterNames (),
286
+ service .getRegisteredRemoteClusterNames (),
275
287
// -cluster_1:* will fail since cluster_1 was never included in order to qualify to be excluded
276
288
new String [] { "-cluster_1:*" , "cluster_2:foo*" , "foo" }
277
289
)
@@ -287,7 +299,7 @@ public void testGroupClusterIndices() throws IOException {
287
299
{
288
300
IllegalArgumentException e = expectThrows (
289
301
IllegalArgumentException .class ,
290
- () -> service .groupClusterIndices (service .getRemoteClusterNames (), new String [] { "-cluster_1:*" })
302
+ () -> service .groupClusterIndices (service .getRegisteredRemoteClusterNames (), new String [] { "-cluster_1:*" })
291
303
);
292
304
assertThat (
293
305
e .getMessage (),
@@ -300,7 +312,7 @@ public void testGroupClusterIndices() throws IOException {
300
312
{
301
313
IllegalArgumentException e = expectThrows (
302
314
IllegalArgumentException .class ,
303
- () -> service .groupClusterIndices (service .getRemoteClusterNames (), new String [] { "-*:*" })
315
+ () -> service .groupClusterIndices (service .getRegisteredRemoteClusterNames (), new String [] { "-*:*" })
304
316
);
305
317
assertThat (
306
318
e .getMessage (),
@@ -315,7 +327,7 @@ public void testGroupClusterIndices() throws IOException {
315
327
316
328
IllegalArgumentException e = expectThrows (
317
329
IllegalArgumentException .class ,
318
- () -> service .groupClusterIndices (service .getRemoteClusterNames (), indices )
330
+ () -> service .groupClusterIndices (service .getRegisteredRemoteClusterNames (), indices )
319
331
);
320
332
assertThat (
321
333
e .getMessage (),
@@ -394,7 +406,7 @@ public void testGroupIndices() throws IOException {
394
406
expectThrows (
395
407
NoSuchRemoteClusterException .class ,
396
408
() -> service .groupClusterIndices (
397
- service .getRemoteClusterNames (),
409
+ service .getRegisteredRemoteClusterNames (),
398
410
new String [] { "foo:bar" , "cluster_1:bar" , "cluster_2:foo:bar" , "cluster_1:test" , "cluster_2:foo*" , "foo" }
399
411
)
400
412
);
0 commit comments