Skip to content

Commit

Permalink
Merge branch 'branch-2.10' into retention-2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
liangyepianzhou committed Feb 6, 2024
2 parents 13ee3d8 + d8a6d98 commit 4618d3c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
import org.apache.pulsar.client.api.Schema;
import org.apache.pulsar.client.impl.ProducerImpl;
import org.apache.pulsar.common.policies.data.TopicStats;
import org.apache.pulsar.common.util.FutureUtil;
import org.junit.Assert;
import org.awaitility.Awaitility;
import org.mockito.Mockito;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Expand Down Expand Up @@ -143,7 +143,7 @@ public void testTopicCloseWhenInternalProducerCloseErrorOnce() throws Exception
(PersistentReplicator) persistentTopic.getReplicators().values().iterator().next();
// Mock an error when calling "replicator.disconnect()"
ProducerImpl mockProducer = Mockito.mock(ProducerImpl.class);
Mockito.when(mockProducer.closeAsync()).thenReturn(CompletableFuture.failedFuture(new Exception("mocked ex")));
Mockito.when(mockProducer.closeAsync()).thenReturn(FutureUtil.failedFuture(new Exception("mocked ex")));
ProducerImpl originalProducer = overrideProducerForReplicator(replicator, mockProducer);
// Verify: since the "replicator.producer.closeAsync()" will retry after it failed, the topic unload should be
// successful.
Expand Down

0 comments on commit 4618d3c

Please sign in to comment.