From 582b0769923c4d5fcda7ce962f6d4ad02469be9d Mon Sep 17 00:00:00 2001 From: coderzc Date: Tue, 20 Sep 2022 17:31:22 +0800 Subject: [PATCH] fix test code --- .../pulsar/broker/delayed/InMemoryDeliveryTrackerTest.java | 1 - .../apache/pulsar/broker/delayed/MockManagedCursor.java | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/delayed/InMemoryDeliveryTrackerTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/delayed/InMemoryDeliveryTrackerTest.java index 069f335c6036db..06f84052f6b11d 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/delayed/InMemoryDeliveryTrackerTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/delayed/InMemoryDeliveryTrackerTest.java @@ -305,7 +305,6 @@ public void testAddMessageWithDeliverAtTimeAfterFullTickTimeWithStrict(DelayedDe // Wait longer than the tick time plus the HashedWheelTimer's tick time to ensure that enough time has // passed where it would have been triggered if the tick time was doing the triggering. Thread.sleep(1000); - verify(dispatcher).getCursor(); // Not wait for the message delivery to get triggered. Awaitility.await().atMost(10, TimeUnit.SECONDS) diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/delayed/MockManagedCursor.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/delayed/MockManagedCursor.java index 51b0aee748f9be..06a33410ba36ed 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/delayed/MockManagedCursor.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/delayed/MockManagedCursor.java @@ -38,7 +38,7 @@ public class MockManagedCursor implements ManagedCursor { private final String name; - private Map cursorProperties; + private final Map cursorProperties; public MockManagedCursor(String name) { this.name = name; @@ -76,6 +76,11 @@ public CompletableFuture putCursorProperty(String key, String value) { return CompletableFuture.completedFuture(null); } + @Override + public CompletableFuture setCursorProperties(Map cursorProperties) { + return CompletableFuture.completedFuture(null); + } + public CompletableFuture removeCursorProperty(String key) { cursorProperties.remove(key); return CompletableFuture.completedFuture(null);