philipnee commented on code in PR #15035: URL: https://github.com/apache/kafka/pull/15035#discussion_r1432199885
########## clients/src/test/java/org/apache/kafka/clients/consumer/internals/HeartbeatRequestManagerTest.java: ########## @@ -660,14 +672,14 @@ private HeartbeatRequestManager createHeartbeatRequestManager() { subscriptions = mock(SubscriptionState.class); membershipManager = mock(MembershipManager.class); backgroundEventHandler = mock(BackgroundEventHandler.class); - heartbeatState = new HeartbeatRequestManager.HeartbeatState(subscriptions, membershipManager, maxPollIntervalMs); - heartbeatRequestState = new HeartbeatRequestManager.HeartbeatRequestState( + heartbeatState = spy(new HeartbeatRequestManager.HeartbeatState(subscriptions, membershipManager, maxPollIntervalMs)); Review Comment: the purpose of spying was to make sure a certain method was invoked. I think this is an acceptable use case, do you agree? -- 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