提交 761508a9 编写于 作者: K keranbingaa

modify unit test of producer

上级 1fdd43c2
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册