Skip to content

Commit

Permalink
Replace assertTrue to assertEquals (apache#16518)
Browse files Browse the repository at this point in the history
  • Loading branch information
Demogorgon314 authored Jul 13, 2022
1 parent 553f341 commit 8002756
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,25 +133,25 @@ public void testConnectionCreation() throws PulsarClientException {
pulsarClient.newProducer(Schema.BOOL).topic("test").create();
pulsarClient.newConsumer(Schema.STRING).topic("test1").subscriptionName("test-sub").subscribe();
// single connection for both producer and consumer
Assert.assertTrue(((CounterBrokerInterceptor)listener).getConnectionCreationCount() == 1);
assertEquals(((CounterBrokerInterceptor) listener).getConnectionCreationCount(), 1);
}

@Test
public void testProducerCreation() throws PulsarClientException {
BrokerInterceptor listener = pulsar.getBrokerInterceptor();
Assert.assertTrue(listener instanceof CounterBrokerInterceptor);
Assert.assertTrue(((CounterBrokerInterceptor)listener).getProducerCount() == 0);
assertEquals(((CounterBrokerInterceptor) listener).getProducerCount(), 0);
pulsarClient.newProducer(Schema.BOOL).topic("test").create();
Assert.assertTrue(((CounterBrokerInterceptor)listener).getProducerCount() == 1);
assertEquals(((CounterBrokerInterceptor) listener).getProducerCount(), 1);
}

@Test
public void testConsumerCreation() throws PulsarClientException {
BrokerInterceptor listener = pulsar.getBrokerInterceptor();
Assert.assertTrue(listener instanceof CounterBrokerInterceptor);
Assert.assertTrue(((CounterBrokerInterceptor)listener).getConsumerCount() == 0);
assertEquals(((CounterBrokerInterceptor) listener).getConsumerCount(), 0);
pulsarClient.newConsumer(Schema.STRING).topic("test1").subscriptionName("test-sub").subscribe();
Assert.assertTrue(((CounterBrokerInterceptor)listener).getConsumerCount() == 1);
assertEquals(((CounterBrokerInterceptor) listener).getConsumerCount(), 1);
}

@Test
Expand Down

0 comments on commit 8002756

Please sign in to comment.