lordcheng10 commented on a change in pull request #12469:
URL: https://github.com/apache/pulsar/pull/12469#discussion_r736153293
##########
File path:
pulsar-client/src/test/java/org/apache/pulsar/client/impl/ConsumerImplTest.java
##########
@@ -187,4 +187,17 @@ public void testBatchReceiveAsyncCanBeCancelled() {
// then
Assert.assertFalse(consumer.hasPendingBatchReceive());
}
+
+ @Test
+ public void testClose() {
+ Exception checkException = null;
+ try {
+ if (consumer != null) {
+ consumer.close();
+ }
+ } catch (Exception e) {
+ checkException = e;
+ }
+ Assert.assertNull(checkException);
Review comment:
By default timeout is null and the nackedMessages is null. By calling
consumer.negativeAcknowledge(new MessageIdImpl(-1, -1, -1)) to make timeout !=
null and nackedMessages != null .
Please review again,thanks! @315157973
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]