brenden20 commented on code in PR #16140:
URL: https://github.com/apache/kafka/pull/16140#discussion_r1621386306


##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkThreadTest.java:
##########
@@ -149,20 +157,28 @@ public void testStartupAndTearDown() throws 
InterruptedException {
                 "The consumer network thread did not stop within " + 
DEFAULT_MAX_WAIT_MS + " ms");
     }
 
+    @Test
+    void testRequestManagersArePolledOnce() {
+        consumerNetworkThread.runOnce();
+        requestManagers.entries().forEach(rmo -> rmo.ifPresent(rm -> 
verify(rm, times(1)).poll(anyLong())));
+        requestManagers.entries().forEach(rmo -> rmo.ifPresent(rm -> 
verify(rm, times(1)).maximumTimeToWait(anyLong())));
+        verify(networkClientDelegate).poll(anyLong(), anyLong());
+    }
+
     @Test
     public void testApplicationEvent() {
         ApplicationEvent e = new PollEvent(100);
         applicationEventsQueue.add(e);
         consumerNetworkThread.runOnce();
-        verify(applicationEventProcessor, times(1)).process(e);
+        verify(applicationEventProcessor).process(e);

Review Comment:
   I checked Mockito documentation and adding times(1) is redundant, so not 
really a big deal either way to keep it or remove it. Do let me know though if 
there is a stylistic preference.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to