jolshan commented on code in PR #14321:
URL: https://github.com/apache/kafka/pull/14321#discussion_r1313636482


##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/consumer/ConsumerGroupTest.java:
##########
@@ -631,4 +631,33 @@ public void testValidateOffsetCommit() {
         // This should succeed.
         group.validateOffsetCommit("member-id", "", 0);
     }
+
+    @Test
+    public void testValidateOffsetFetch() {
+        SnapshotRegistry snapshotRegistry = new SnapshotRegistry(new 
LogContext());
+        ConsumerGroup group = new ConsumerGroup(snapshotRegistry, "group-foo");
+
+        // Simulate a call from the admin client without member id and member 
epoch.
+        // This should pass only if the group is empty.
+        group.validateOffsetFetch("", -1, Long.MAX_VALUE);
+
+        // The member does not exist.
+        assertThrows(UnknownMemberIdException.class, () ->
+            group.validateOffsetFetch("member-id", 0, Long.MAX_VALUE));
+
+        // Create a member.
+        snapshotRegistry.getOrCreateSnapshot(0);
+        group.getOrMaybeCreateMember("member-id", true);
+
+        // The member does not exist at epoch 0.

Review Comment:
   Should this be offset 0? Epoch 0 seems to be correct in the last line of the 
test



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