riedelmax commented on code in PR #14544:
URL: https://github.com/apache/kafka/pull/14544#discussion_r1398236262


##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/GroupMetadataManagerTest.java:
##########
@@ -8660,6 +8665,68 @@ public void testListGroups() {
         assertEquals(expectAllGroupMap, actualAllGroupMap);
     }
 
+    @Test
+    public void testConsumerGroupDescribeNoErrors() {
+        String consumerGroupId = "consumerGroupId";
+        int epoch = 10;
+        String memberId = Uuid.randomUuid().toString();
+        String topicName = "topicName";
+
+        MockPartitionAssignor assignor = new MockPartitionAssignor("range");
+        GroupMetadataManagerTestContext context = new 
GroupMetadataManagerTestContext.Builder()
+            .withAssignors(Collections.singletonList(assignor))
+            .withConsumerGroup(new ConsumerGroupBuilder(consumerGroupId, 
epoch))
+            .build();
+
+        ConsumerGroupMember.Builder memberBuilder = new 
ConsumerGroupMember.Builder(memberId)
+            .setSubscribedTopicNames(Collections.singletonList(topicName));
+        context.replay(RecordHelpers.newMemberSubscriptionRecord(
+            consumerGroupId,
+            memberBuilder.build()
+        ));
+        context.replay(RecordHelpers.newGroupEpochRecord(consumerGroupId, 
epoch + 1));
+
+        List<ConsumerGroupDescribeResponseData.DescribedGroup> actual = 
context.sendConsumerGroupDescribe(Arrays.asList(consumerGroupId));
+        ConsumerGroupDescribeResponseData.DescribedGroup describedGroup = new 
ConsumerGroupDescribeResponseData.DescribedGroup();
+        describedGroup.setGroupEpoch(epoch + 1);
+        describedGroup.setGroupId(consumerGroupId);
+        
describedGroup.setMembers(Collections.singletonList(memberBuilder.build().asConsumerGroupDescribeMember()));
+        describedGroup.setAssignorName(null);
+        describedGroup.setGroupState("assigning");
+        List<ConsumerGroupDescribeResponseData.DescribedGroup> expected = 
Collections.singletonList(
+            describedGroup
+        );
+
+        assertEquals(expected, actual);
+    }

Review Comment:
   I finally managed to implement this. I struggled a little bit on how to add 
the group correctly without commiting the offset, but I think I got it now.



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