chia7712 commented on code in PR #22328:
URL: https://github.com/apache/kafka/pull/22328#discussion_r3521136450
##########
storage/src/test/java/org/apache/kafka/server/log/remote/metadata/storage/ConsumerTaskTest.java:
##########
@@ -104,6 +112,20 @@ public void testCloseOnNoAssignment() {
assertDoesNotThrow(() -> consumerTask.closeConsumer(), "CloseConsumer
method threw exception");
}
+ @Test
+ public void testCloseBeforeAssignmentDoesNotPollConsumer() {
+ final Consumer<byte[], byte[]> mockConsumer = mock(Consumer.class);
+ when(mockConsumer.poll(any(Duration.class)))
Review Comment:
```java
when(mockConsumer.poll(any(Duration.class)))
.thenThrow(new AssertionError("poll() should not be called when
ConsumerTask is closed before any partition assignment"));
```
this is unnecessary due to following verify, right?
--
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]