mirror of
https://github.com/apache/rocketmq.git
synced 2026-10-29 17:25:35 +08:00
modify unit test of producer
This commit is contained in:
@@ -185,7 +185,7 @@ public class DefaultMQProducerTest {
|
||||
@Test
|
||||
public void testSendMessageAsync_Success() throws RemotingException, InterruptedException, MQBrokerException, MQClientException {
|
||||
final CountDownLatch countDownLatch = new CountDownLatch(1);
|
||||
// final AtomicInteger cc = new AtomicInteger(0);
|
||||
final AtomicInteger cc = new AtomicInteger(0);
|
||||
when(mQClientAPIImpl.getTopicRouteInfoFromNameServer(anyString(), anyLong())).thenReturn(createTopicRoute());
|
||||
producer.send(message, new SendCallback() {
|
||||
@Override
|
||||
@@ -194,7 +194,7 @@ public class DefaultMQProducerTest {
|
||||
assertThat(sendResult.getOffsetMsgId()).isEqualTo("123");
|
||||
assertThat(sendResult.getQueueOffset()).isEqualTo(456L);
|
||||
countDownLatch.countDown();
|
||||
// cc.incrementAndGet();
|
||||
cc.incrementAndGet();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -202,7 +202,7 @@ public class DefaultMQProducerTest {
|
||||
}
|
||||
});
|
||||
countDownLatch.await(3000L, TimeUnit.MILLISECONDS);
|
||||
// assertThat(cc.get()).isEqualTo(1);
|
||||
assertThat(cc.get()).isEqualTo(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user