C0urante commented on code in PR #14587:
URL: https://github.com/apache/kafka/pull/14587#discussion_r1366159693


##########
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/MirrorCheckpointTaskTest.java:
##########
@@ -169,6 +169,33 @@ public void testSyncOffset() {
                 "Consumer 2 " + topic2 + " failed");
     }
 
+    @Test
+    public void testSyncOffsetForTargetGroupWithNullOffsetAndMetadata() {
+        Map<String, Map<TopicPartition, OffsetAndMetadata>> 
idleConsumerGroupsOffset = new HashMap<>();
+        Map<String, Map<TopicPartition, Checkpoint>> 
checkpointsPerConsumerGroup = new HashMap<>();
+
+        String consumer = "consumer";
+        String topic = "topic";
+        Map<TopicPartition, OffsetAndMetadata> ct = new HashMap<>();
+        TopicPartition tp = new TopicPartition(topic, 0);
+        // Simulate other clients such as sarama to reset the group offset of 
the target cluster to -1. At this time,
+        // the obtained `OffsetAndMetadata` of the target cluster is null.

Review Comment:
   ```suggestion
           // Simulate other clients such as Sarama, which may reset group 
offsets to -1. This can cause
           // the obtained `OffsetAndMetadata` of the target cluster to be null.
   ```



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