philipnee commented on code in PR #15035: URL: https://github.com/apache/kafka/pull/15035#discussion_r1432925646
########## clients/src/test/java/org/apache/kafka/clients/consumer/internals/HeartbeatRequestManagerTest.java: ########## @@ -525,16 +526,37 @@ public void testHeartbeatState() { @Test public void testPollTimerExpiration() { - heartbeatRequestManager = createHeartbeatRequestManager(); + coordinatorRequestManager = mock(CoordinatorRequestManager.class); + membershipManager = mock(MembershipManager.class); + heartbeatState = mock(HeartbeatRequestManager.HeartbeatState.class); + heartbeatRequestState = spy(new HeartbeatRequestManager.HeartbeatRequestState( Review Comment: it is there to verify the reset call and we also need a real object to ensure the manager can send a request. If we mock it, then we have to mock the canSendRequest call, then it is pointless to verify the request returned from poll because it will always return one. -- 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