aliehsaeedii commented on code in PR #17414:
URL: https://github.com/apache/kafka/pull/17414#discussion_r1795608179


##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerInterceptorsTest.java:
##########
@@ -126,9 +131,15 @@ public void testOnConsumeChain() {
         list3.add(new ConsumerRecord<>(filterTopicPart2.topic(), 
filterTopicPart2.partition(), 0, 0L, TimestampType.CREATE_TIME,
             0, 0, 1, 1, new RecordHeaders(), Optional.empty()));
         records.put(tp, list1);
+        nextOffsets.put(tp, new OffsetAndMetadata(1, Optional.empty(), ""));
+
         records.put(filterTopicPart1, list2);
+        nextOffsets.put(filterTopicPart1, new OffsetAndMetadata(1, 
Optional.empty(), ""));
+
         records.put(filterTopicPart2, list3);
-        ConsumerRecords<Integer, Integer> consumerRecords = new 
ConsumerRecords<>(records);
+        nextOffsets.put(filterTopicPart2, new OffsetAndMetadata(1, 
Optional.empty(), ""));
+
+        ConsumerRecords<Integer, Integer> consumerRecords = new 
ConsumerRecords<>(records, nextOffsets);
         ConsumerRecords<Integer, Integer> interceptedRecords = 
interceptors.onConsume(consumerRecords);
         assertEquals(1, interceptedRecords.count());
         assertTrue(interceptedRecords.partitions().contains(tp));

Review Comment:
   >those topic partitions are filtered out?
   but we still keep the filtered out tps in `nextOffsets` map.



##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerInterceptorsTest.java:
##########
@@ -126,9 +131,15 @@ public void testOnConsumeChain() {
         list3.add(new ConsumerRecord<>(filterTopicPart2.topic(), 
filterTopicPart2.partition(), 0, 0L, TimestampType.CREATE_TIME,
             0, 0, 1, 1, new RecordHeaders(), Optional.empty()));
         records.put(tp, list1);
+        nextOffsets.put(tp, new OffsetAndMetadata(1, Optional.empty(), ""));
+
         records.put(filterTopicPart1, list2);
+        nextOffsets.put(filterTopicPart1, new OffsetAndMetadata(1, 
Optional.empty(), ""));
+
         records.put(filterTopicPart2, list3);
-        ConsumerRecords<Integer, Integer> consumerRecords = new 
ConsumerRecords<>(records);
+        nextOffsets.put(filterTopicPart2, new OffsetAndMetadata(1, 
Optional.empty(), ""));
+
+        ConsumerRecords<Integer, Integer> consumerRecords = new 
ConsumerRecords<>(records, nextOffsets);
         ConsumerRecords<Integer, Integer> interceptedRecords = 
interceptors.onConsume(consumerRecords);
         assertEquals(1, interceptedRecords.count());
         assertTrue(interceptedRecords.partitions().contains(tp));

Review Comment:
   >those topic partitions are filtered out?
   
   but we still keep the filtered out tps in `nextOffsets` map.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to