Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason918 committed Dec 2, 2021
1 parent 060b675 commit 64e2b34
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ public void testProducerOverwrite() throws Exception {

private void testMaxProducers() throws Exception {
PersistentTopic topic = new PersistentTopic(successTopicName, ledgerMock, brokerService);
topic.initialize();
String role = "appid1";
// 1. add producer1
Producer producer = new Producer(topic, serverCnx, 1 /* producer id */, "prod-name1", role,
Expand Down Expand Up @@ -577,8 +578,11 @@ public void testMaxProducersForNamespace() throws Exception {
.thenReturn(Optional.of(policies));

when(pulsar.getPulsarResources().getNamespaceResources()
.getPolicies(TopicName.get(successTopicName).getNamespaceObject()))
.thenReturn(Optional.of(policies));
.getPolicies(TopicName.get(successTopicName).getNamespaceObject()))
.thenReturn(Optional.of(policies));
when(pulsar.getPulsarResources().getNamespaceResources()
.getPoliciesAsync(TopicName.get(successTopicName).getNamespaceObject()))
.thenReturn(CompletableFuture.completedFuture(Optional.of(policies)));
testMaxProducers();
}

Expand Down

0 comments on commit 64e2b34

Please sign in to comment.