@@ -170,7 +170,7 @@ public void testGroupClusterIndices() throws IOException {
170170 assertFalse (service .isRemoteClusterRegistered ("foo" ));
171171 {
172172 Map <String , List <String >> perClusterIndices = service .groupClusterIndices (
173- service .getRemoteClusterNames (),
173+ service .getRegisteredRemoteClusterNames (),
174174 new String [] {
175175 "cluster_1:bar" ,
176176 "cluster_2:foo:bar" ,
@@ -191,15 +191,15 @@ public void testGroupClusterIndices() throws IOException {
191191 expectThrows (
192192 NoSuchRemoteClusterException .class ,
193193 () -> service .groupClusterIndices (
194- service .getRemoteClusterNames (),
194+ service .getRegisteredRemoteClusterNames (),
195195 new String [] { "foo:bar" , "cluster_1:bar" , "cluster_2:foo:bar" , "cluster_1:test" , "cluster_2:foo*" , "foo" }
196196 )
197197 );
198198
199199 expectThrows (
200200 NoSuchRemoteClusterException .class ,
201201 () -> service .groupClusterIndices (
202- service .getRemoteClusterNames (),
202+ service .getRegisteredRemoteClusterNames (),
203203 new String [] { "cluster_1:bar" , "cluster_2:foo:bar" , "cluster_1:test" , "cluster_2:foo*" , "does_not_exist:*" }
204204 )
205205 );
@@ -208,7 +208,10 @@ public void testGroupClusterIndices() throws IOException {
208208 {
209209 String [] indices = shuffledList (List .of ("cluster*:foo*" , "foo" , "-cluster_1:*" , "*:boo" )).toArray (new String [0 ]);
210210
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+ );
212215 assertEquals (2 , perClusterIndices .size ());
213216 List <String > localIndexes = perClusterIndices .get (RemoteClusterAware .LOCAL_CLUSTER_GROUP_KEY );
214217 assertNotNull (localIndexes );
@@ -223,7 +226,10 @@ public void testGroupClusterIndices() throws IOException {
223226 {
224227 String [] indices = shuffledList (List .of ("*:*" , "-clu*_1:*" , "*:boo" )).toArray (new String [0 ]);
225228
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+ );
227233 assertEquals (1 , perClusterIndices .size ());
228234
229235 List <String > cluster2 = perClusterIndices .get ("cluster_2" );
@@ -236,7 +242,10 @@ public void testGroupClusterIndices() throws IOException {
236242 new String [0 ]
237243 );
238244
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+ );
240249 assertEquals (1 , perClusterIndices .size ());
241250 List <String > localIndexes = perClusterIndices .get (RemoteClusterAware .LOCAL_CLUSTER_GROUP_KEY );
242251 assertNotNull (localIndexes );
@@ -246,7 +255,10 @@ public void testGroupClusterIndices() throws IOException {
246255 {
247256 String [] indices = shuffledList (List .of ("cluster*:*" , "foo" , "-*:*" )).toArray (new String [0 ]);
248257
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+ );
250262 assertEquals (1 , perClusterIndices .size ());
251263 List <String > localIndexes = perClusterIndices .get (RemoteClusterAware .LOCAL_CLUSTER_GROUP_KEY );
252264 assertNotNull (localIndexes );
@@ -257,7 +269,7 @@ public void testGroupClusterIndices() throws IOException {
257269 IllegalArgumentException e = expectThrows (
258270 IllegalArgumentException .class ,
259271 () -> service .groupClusterIndices (
260- service .getRemoteClusterNames (),
272+ service .getRegisteredRemoteClusterNames (),
261273 // -cluster_1:foo* is not allowed, only -cluster_1:*
262274 new String [] { "cluster_1:bar" , "-cluster_2:foo*" , "cluster_1:test" , "cluster_2:foo*" , "foo" }
263275 )
@@ -271,7 +283,7 @@ public void testGroupClusterIndices() throws IOException {
271283 IllegalArgumentException e = expectThrows (
272284 IllegalArgumentException .class ,
273285 () -> service .groupClusterIndices (
274- service .getRemoteClusterNames (),
286+ service .getRegisteredRemoteClusterNames (),
275287 // -cluster_1:* will fail since cluster_1 was never included in order to qualify to be excluded
276288 new String [] { "-cluster_1:*" , "cluster_2:foo*" , "foo" }
277289 )
@@ -287,7 +299,7 @@ public void testGroupClusterIndices() throws IOException {
287299 {
288300 IllegalArgumentException e = expectThrows (
289301 IllegalArgumentException .class ,
290- () -> service .groupClusterIndices (service .getRemoteClusterNames (), new String [] { "-cluster_1:*" })
302+ () -> service .groupClusterIndices (service .getRegisteredRemoteClusterNames (), new String [] { "-cluster_1:*" })
291303 );
292304 assertThat (
293305 e .getMessage (),
@@ -300,7 +312,7 @@ public void testGroupClusterIndices() throws IOException {
300312 {
301313 IllegalArgumentException e = expectThrows (
302314 IllegalArgumentException .class ,
303- () -> service .groupClusterIndices (service .getRemoteClusterNames (), new String [] { "-*:*" })
315+ () -> service .groupClusterIndices (service .getRegisteredRemoteClusterNames (), new String [] { "-*:*" })
304316 );
305317 assertThat (
306318 e .getMessage (),
@@ -315,7 +327,7 @@ public void testGroupClusterIndices() throws IOException {
315327
316328 IllegalArgumentException e = expectThrows (
317329 IllegalArgumentException .class ,
318- () -> service .groupClusterIndices (service .getRemoteClusterNames (), indices )
330+ () -> service .groupClusterIndices (service .getRegisteredRemoteClusterNames (), indices )
319331 );
320332 assertThat (
321333 e .getMessage (),
@@ -394,7 +406,7 @@ public void testGroupIndices() throws IOException {
394406 expectThrows (
395407 NoSuchRemoteClusterException .class ,
396408 () -> service .groupClusterIndices (
397- service .getRemoteClusterNames (),
409+ service .getRegisteredRemoteClusterNames (),
398410 new String [] { "foo:bar" , "cluster_1:bar" , "cluster_2:foo:bar" , "cluster_1:test" , "cluster_2:foo*" , "foo" }
399411 )
400412 );
0 commit comments