clolov commented on code in PR #13240: URL: https://github.com/apache/kafka/pull/13240#discussion_r1197988726
########## clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinatorTest.java: ########## @@ -3981,23 +4348,13 @@ private void prepareJoinAndSyncResponse(String consumerId, int generation, List< }, syncGroupResponse(assignment, Errors.NONE)); } - private Map<TopicPartition, Errors> partitionErrors(Collection<TopicPartition> partitions, Errors error) { - final Map<TopicPartition, Errors> errors = new HashMap<>(); - for (TopicPartition partition : partitions) { - errors.put(partition, error); - } - return errors; - } - - private void respondToOffsetCommitRequest(final Map<TopicPartition, Long> expectedOffsets, Errors error) { - Map<TopicPartition, Errors> errors = partitionErrors(expectedOffsets.keySet(), error); - client.respond(offsetCommitRequestMatcher(expectedOffsets), offsetCommitResponse(errors)); - } - - private MockClient.RequestMatcher offsetCommitRequestMatcher(final Map<TopicPartition, Long> expectedOffsets) { + private MockClient.RequestMatcher offsetCommitRequestMatcher( + Map<TopicPartition, Long> expectedOffsets, + Consumer<OffsetCommitRequest> requestConsumer Review Comment: From my reading of the code this consumer is a captor. We validate some of the things in this method and we validate the overall captured value elsewhere in individual tests. I am not too certain how this can be simplified to just a matcher to be honest. -- 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