frankvicky commented on code in PR #16227:
URL: https://github.com/apache/kafka/pull/16227#discussion_r1632055803


##########
clients/src/test/java/org/apache/kafka/clients/consumer/ConsumerRecordsTest.java:
##########
@@ -35,28 +35,83 @@ public class ConsumerRecordsTest {
 
     @Test
     public void iterator() throws Exception {
+        String topic = "topic";
+        int recordSize = 10;
+        int partitionSize = 10;
+        int emptyPartitionInterval = 3;
+        ConsumerRecords<Integer, String> records = 
buildTopicTestRecords(recordSize, partitionSize, emptyPartitionInterval, topic);
+        Iterator<ConsumerRecord<Integer, String>> iterator = 
records.iterator();
+
+        for (int count = 0; iterator.hasNext(); count++) {
+            if (count % emptyPartitionInterval != 0) {
+                int offset = 0;
+                for (; offset < recordSize; offset++) {
+                    ConsumerRecord<Integer, String> record = iterator.next();
+                    assertEquals(count, record.partition());
+                    assertEquals(topic, record.topic());
+                    assertEquals(offset, record.offset());

Review Comment:
   Oops, I miss both of them.



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

Reply via email to