@@ -366,20 +366,18 @@ public void onFailure(Exception e) {
366
366
367
367
updateLatch .await (5 , TimeUnit .SECONDS );
368
368
369
- // Delete a rule fails
369
+ // Delete a rule does not fail
370
370
CountDownLatch deleteLatch = new CountDownLatch (1 );
371
371
synonymsManagementAPIService .deleteSynonymRule (synonymSetId , synonymRuleId , true , new ActionListener <>() {
372
372
@ Override
373
373
public void onResponse (SynonymsManagementAPIService .SynonymsReloadResult synonymsReloadResult ) {
374
- fail ( "Shouldn't have been able to delete a synonym rule with refresh in synonyms index health" );
374
+ updateLatch . countDown ( );
375
375
}
376
376
377
377
@ Override
378
378
public void onFailure (Exception e ) {
379
379
// Expected
380
- assertTrue (e instanceof IndexCreationException );
381
- assertTrue (e .getMessage ().contains ("synonyms index [.synonyms] is not searchable" ));
382
- updateLatch .countDown ();
380
+ fail ("Should have been able to delete a synonym rule" );
383
381
}
384
382
});
385
383
@@ -418,21 +416,5 @@ public void onFailure(Exception e) {
418
416
});
419
417
420
418
putRuleNoRefreshLatch .await (5 , TimeUnit .SECONDS );
421
-
422
- // Same for delete
423
- CountDownLatch deleteNoRefreshLatch = new CountDownLatch (1 );
424
- synonymsManagementAPIService .deleteSynonymRule (synonymSetId , synonymRuleId , false , new ActionListener <>() {
425
- @ Override
426
- public void onResponse (SynonymsManagementAPIService .SynonymsReloadResult synonymsReloadResult ) {
427
- deleteNoRefreshLatch .countDown ();
428
- }
429
-
430
- @ Override
431
- public void onFailure (Exception e ) {
432
- fail (e );
433
- }
434
- });
435
-
436
- deleteNoRefreshLatch .await (5 , TimeUnit .SECONDS );
437
419
}
438
420
}
0 commit comments