Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Zixuan Liu <[email protected]>
  • Loading branch information
nodece committed May 15, 2024
1 parent 261af0c commit d856162
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1801,6 +1801,7 @@ public void testAtomicReplicationRemoval() throws Exception {
.getCluster(remoteCluster))));
replicatorMap.put(remoteReplicatorName, replicator);

String cursorName = PersistentReplicator.getReplicatorName(topic.getReplicatorPrefix(), remoteReplicatorName);
// step-1 remove replicator : it will disconnect the producer but it will wait for callback to be completed
Method removeMethod = PersistentTopic.class.getDeclaredMethod("removeReplicator", String.class);
removeMethod.setAccessible(true);
Expand All @@ -1815,7 +1816,7 @@ public void testAtomicReplicationRemoval() throws Exception {

// step-3 : complete the callback to remove replicator from the list
ArgumentCaptor<DeleteCursorCallback> captor = ArgumentCaptor.forClass(DeleteCursorCallback.class);
Mockito.verify(ledgerMock).asyncDeleteCursor(any(), captor.capture(), any());
Mockito.verify(ledgerMock).asyncDeleteCursor(eq(cursorName), captor.capture(), any());
DeleteCursorCallback callback = captor.getValue();
callback.deleteCursorComplete(null);
}
Expand Down

0 comments on commit d856162

Please sign in to comment.