From 3290f2a71d3752cf64c45ee1f633d2171c0d34d0 Mon Sep 17 00:00:00 2001 From: Zixuan Liu Date: Tue, 16 Apr 2024 16:19:13 +0800 Subject: [PATCH] Fix test Signed-off-by: Zixuan Liu --- .../org/apache/pulsar/broker/service/PersistentTopicTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 d5044276a5a635..4e1aab1df29120 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 @@ -1742,6 +1742,7 @@ public CompletableFuture createAsync() { brokerService.pulsar().getPulsarResources().getClusterResources() .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); @@ -1757,7 +1758,7 @@ public CompletableFuture createAsync() { // 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); }