ojasvajain commented on code in PR #23726:
URL: https://github.com/apache/kafka/pull/23726#discussion_r4297128540
##########
clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientConsumerGroupTest.java:
##########
@@ -3012,6 +3012,25 @@ public void testRemoveMembersFromGroup() throws
Exception {
}
}
+ @Test
+ public void testRemoveAllMembersFromEmptyGroup() throws Exception {
+ // "removeAll" on a group with no members should be a successful no-op
+ try (AdminClientUnitTestEnv env = new
AdminClientUnitTestEnv(mockCluster(1, 0))) {
+ env.kafkaClient().setNodeApiVersions(NodeApiVersions.create());
+
+ DescribeGroupsResponseData data =
prepareDescribeGroupsResponseData(GROUP_ID, List.of(), List.of());
+
env.kafkaClient().prepareResponse(prepareFindCoordinatorResponse(Errors.NONE,
env.cluster().controller()));
+ env.kafkaClient().prepareResponse(new
DescribeGroupsResponse(data));
+
+ final RemoveMembersFromConsumerGroupResult result =
env.adminClient().removeMembersFromConsumerGroup(
Review Comment:
We don't have an explicit assertion for it but this test case is checking it
indirectly. We are only queuing the responses for the two requests so if a
leave group request is made, the test case would timeout waiting for the mock
response to come and will eventually fail.
However, I have updated the test to check it explicitly. I am queuing the
mock responses for find coordinator and leave group requests and checking if
they were NOT consumed.
--
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]