mimaison commented on a change in pull request #8295:
URL: https://github.com/apache/kafka/pull/8295#discussion_r469841392



##########
File path: 
clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java
##########
@@ -584,14 +590,22 @@ public void 
testFetchProgressWithMissingPartitionPosition() {
         consumer.seekToEnd(singleton(tp0));
         consumer.seekToBeginning(singleton(tp1));
 
-        client.prepareResponse(
-            body -> {
-                ListOffsetRequest request = (ListOffsetRequest) body;
-                Map<TopicPartition, ListOffsetRequest.PartitionData> 
timestamps = request.partitionTimestamps();
-                return timestamps.get(tp0).timestamp == 
ListOffsetRequest.LATEST_TIMESTAMP &&
-                        timestamps.get(tp1).timestamp == 
ListOffsetRequest.EARLIEST_TIMESTAMP;
-            }, listOffsetsResponse(Collections.singletonMap(tp0, 50L),
-                        Collections.singletonMap(tp1, 
Errors.NOT_LEADER_OR_FOLLOWER)));
+        client.prepareResponse(body -> {
+            ListOffsetRequest request = (ListOffsetRequest) body;
+            List<ListOffsetPartition> partitions = 
request.topics().stream().flatMap(topic -> {
+                if (topic.name().equals(tp0.topic()))

Review comment:
       It's because `tp0` and `tp1` are on the same topic. I'm updating this 
check to use `topic` instead so it's clearer




----------------------------------------------------------------
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


Reply via email to