mimaison commented on a change in pull request #8295: URL: https://github.com/apache/kafka/pull/8295#discussion_r490947807
########## File path: clients/src/test/java/org/apache/kafka/clients/consumer/internals/FetcherTest.java ########## @@ -2496,46 +2501,81 @@ public void testGetOffsetByTimeWithPartitionsRetryCouldTriggerMetadataUpdate() { client.updateMetadata(initialUpdateResponse); final long fetchTimestamp = 10L; - Map<TopicPartition, ListOffsetResponse.PartitionData> allPartitionData = new HashMap<>(); - allPartitionData.put(tp0, new ListOffsetResponse.PartitionData( - Errors.NONE, fetchTimestamp, 4L, Optional.empty())); - allPartitionData.put(tp1, new ListOffsetResponse.PartitionData( - retriableError, ListOffsetRequest.LATEST_TIMESTAMP, -1L, Optional.empty())); + List<ListOffsetTopicResponse> topics = Collections.singletonList( + new ListOffsetTopicResponse() + .setName(tp0.topic()) + .setPartitions(Arrays.asList( + new ListOffsetPartitionResponse() Review comment: It's relatively common to ident twice when it's in 2 calls from the line above, ie `setPartitions()` and `Arrays.asList()`. For example, it's also done in: - https://github.com/apache/kafka/blame/trunk/clients/src/test/java/org/apache/kafka/clients/consumer/internals/FetcherTest.java#L3165-L3168 - https://github.com/apache/kafka/blame/trunk/clients/src/test/java/org/apache/kafka/clients/consumer/internals/FetcherTest.java#L3724-L3725 ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org