315157973 commented on a change in pull request #12469:
URL: https://github.com/apache/pulsar/pull/12469#discussion_r736158232
##########
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:
Then why not close Consumer after calling consumer.negativeAcknowledge?
Your unit test has no way to confirm that the Tracker is closed, and we
can't even confirm that the close method has been called.
--
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]