@@ -393,10 +393,10 @@ public void testHandleDeleteResponse_WithDeleteAllMemories_Success() {
393393
394394 // Mock countContainersWithPrefix to return 1 (sole owner - safe to delete indices)
395395 doAnswer (invocation -> {
396- ActionListener <Long > listener = invocation .getArgument (2 );
396+ ActionListener <Long > listener = invocation .getArgument (1 );
397397 listener .onResponse (1L );
398398 return null ;
399- }).when (memoryContainerHelper ).countContainersWithPrefix (any (), any (), any () );
399+ }).when (memoryContainerHelper ).countContainersWithPrefix (any (), any ());
400400
401401 // Mock successful deleteIndex operation
402402 doAnswer (invocation -> {
@@ -466,10 +466,10 @@ public void testHandleDeleteResponse_WithDeleteAllMemories_DeleteIndexFailure()
466466
467467 // Mock countContainersWithPrefix to return 1 (sole owner - safe to delete indices)
468468 doAnswer (invocation -> {
469- ActionListener <Long > listener = invocation .getArgument (2 );
469+ ActionListener <Long > listener = invocation .getArgument (1 );
470470 listener .onResponse (1L );
471471 return null ;
472- }).when (memoryContainerHelper ).countContainersWithPrefix (any (), any (), any () );
472+ }).when (memoryContainerHelper ).countContainersWithPrefix (any (), any ());
473473
474474 // Mock failed deleteIndex operation
475475 doAnswer (invocation -> {
@@ -613,10 +613,10 @@ public void testDeleteMemoryContainer_WithSelectiveMemories_Success() {
613613
614614 // Mock countContainersWithPrefix to return 1 (sole owner - safe to delete indices)
615615 doAnswer (invocation -> {
616- ActionListener <Long > listener = invocation .getArgument (2 );
616+ ActionListener <Long > listener = invocation .getArgument (1 );
617617 listener .onResponse (1L );
618618 return null ;
619- }).when (memoryContainerHelper ).countContainersWithPrefix (any (), any (), any () );
619+ }).when (memoryContainerHelper ).countContainersWithPrefix (any (), any ());
620620
621621 // Mock successful deleteIndex operation
622622 doAnswer (invocation -> {
@@ -684,10 +684,10 @@ public void testDeleteMemoryContainer_WithSelectiveMemories_UnknownType() {
684684
685685 // Mock countContainersWithPrefix to return 1 (sole owner - safe to delete indices)
686686 doAnswer (invocation -> {
687- ActionListener <Long > listener = invocation .getArgument (2 );
687+ ActionListener <Long > listener = invocation .getArgument (1 );
688688 listener .onResponse (1L );
689689 return null ;
690- }).when (memoryContainerHelper ).countContainersWithPrefix (any (), any (), any () );
690+ }).when (memoryContainerHelper ).countContainersWithPrefix (any (), any ());
691691
692692 // Mock successful deleteIndex operation
693693 doAnswer (invocation -> {
@@ -789,10 +789,10 @@ public void testDeleteMemoryContainer_WithSharedPrefix_PreventsDeletion() {
789789
790790 // Mock countContainersWithPrefix to return 2 (shared prefix - unsafe to delete indices)
791791 doAnswer (invocation -> {
792- ActionListener <Long > listener = invocation .getArgument (2 );
792+ ActionListener <Long > listener = invocation .getArgument (1 );
793793 listener .onResponse (2L );
794794 return null ;
795- }).when (memoryContainerHelper ).countContainersWithPrefix (any (), any (), any () );
795+ }).when (memoryContainerHelper ).countContainersWithPrefix (any (), any ());
796796
797797 // Execute
798798 transportDeleteMemoryContainerAction .doExecute (null , deleteRequest , actionListener );
@@ -847,7 +847,7 @@ public void testDeleteMemoryContainer_CountCheckFailure_AbortsOperation() {
847847 ActionListener <Long > listener = invocation .getArgument (2 );
848848 listener .onFailure (new RuntimeException ("Failed to count containers" ));
849849 return null ;
850- }).when (memoryContainerHelper ).countContainersWithPrefix (any (), any (), any () );
850+ }).when (memoryContainerHelper ).countContainersWithPrefix (any (), any ());
851851
852852 // Execute
853853 transportDeleteMemoryContainerAction .doExecute (null , deleteRequest , actionListener );
@@ -903,7 +903,7 @@ public void testDeleteMemoryContainer_WithoutIndexDeletion_SkipsCountCheck() {
903903 transportDeleteMemoryContainerAction .doExecute (null , deleteRequest , actionListener );
904904
905905 // Verify countContainersWithPrefix was NEVER called (no index deletion requested)
906- verify (memoryContainerHelper , timeout (1000 ).times (0 )).countContainersWithPrefix (any (), any (), any () );
906+ verify (memoryContainerHelper , timeout (1000 ).times (0 )).countContainersWithPrefix (any (), any ());
907907
908908 // Verify deleteIndex was NEVER called
909909 verify (memoryContainerHelper , timeout (1000 ).times (0 )).deleteIndex (any (), any (), any ());
0 commit comments