diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicTest.java index eda962e2701899..ca9568ed73c680 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicTest.java @@ -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); @@ -1815,7 +1816,7 @@ public void testAtomicReplicationRemoval() throws Exception { // step-3 : complete the callback to remove replicator from the list ArgumentCaptor 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); }