You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ch...@apache.org on 2026/09/24 07:50:47 UTC

(kafka) branch trunk updated: MINOR: Avoid unnecessary cluster setup in ListConsumerGroupTest (#23378)

This is an automated email from the ASF dual-hosted git repository.

chia7712 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new d287b18fec0 MINOR: Avoid unnecessary cluster setup in ListConsumerGroupTest (#23378)
d287b18fec0 is described below

commit d287b18fec0d83149073f9ace388daee04e25cbb
Author: Russole Chen <54...@users.noreply.github.com>
AuthorDate: Thu Sep 24 15:50:40 2026 +0800

    MINOR: Avoid unnecessary cluster setup in ListConsumerGroupTest (#23378)
    
    ### Summary
    
    Move tests that do not require a cluster from `ListConsumerGroupTest` to
    `ConsumerGroupCommandTest`.
    
    This keeps `ListConsumerGroupTest` focused on cluster-backed tests while
    avoiding unnecessary cluster startup for argument and string parsing
    tests.
    
    Additional cleanup includes:
    
    - Use `ClusterInstance` for topic creation and Admin client access.
    - Remove the redundant `set(...)` helper.
    - Use typed `Set` and `AtomicReference` declarations.
    
    ### Testing
    
    Passed locally:
    
    ```bash
    ./gradlew :tools:spotlessJavaCheck :tools:test \
      --tests org.apache.kafka.tools.consumer.group.ConsumerGroupCommandTest
    \
      --tests org.apache.kafka.tools.consumer.group.ListConsumerGroupTest
    ```
    
    Reviewers: Andrew Schofield <as...@confluent.io>, Ken Huang
     <s7...@gmail.com>, Chia-Ping Tsai <ch...@gmail.com>
---
 .../consumer/group/ConsumerGroupCommandTest.java   |  62 +++++++++
 .../consumer/group/ListConsumerGroupTest.java      | 149 +++++----------------
 2 files changed, 93 insertions(+), 118 deletions(-)

diff --git a/tools/src/test/java/org/apache/kafka/tools/consumer/group/ConsumerGroupCommandTest.java b/tools/src/test/java/org/apache/kafka/tools/consumer/group/ConsumerGroupCommandTest.java
index 000a882347a..eaec38318d6 100644
--- a/tools/src/test/java/org/apache/kafka/tools/consumer/group/ConsumerGroupCommandTest.java
+++ b/tools/src/test/java/org/apache/kafka/tools/consumer/group/ConsumerGroupCommandTest.java
@@ -16,15 +16,28 @@
  */
 package org.apache.kafka.tools.consumer.group;
 
+import org.apache.kafka.common.GroupState;
+import org.apache.kafka.common.GroupType;
 import org.apache.kafka.tools.ToolsTestUtils;
 
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.junit.jupiter.params.provider.ValueSource;
 
 import java.util.List;
+import java.util.Set;
+import java.util.stream.Stream;
+
+import joptsimple.OptionException;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 public class ConsumerGroupCommandTest {
+    private static final String DUMMY_BOOTSTRAP_SERVERS = "localhost:9092";
+
     @Test
     public void testValidateRegexCommandWithValidRegex() {
         String output = ToolsTestUtils.grabConsoleOutput(
@@ -54,4 +67,53 @@ public class ConsumerGroupCommandTest {
             output
         );
     }
+
+    @Test
+    public void testListWithUnrecognizedNewConsumerOption() {
+        String[] cgcArgs = new String[]{"--new-consumer", "--bootstrap-server", DUMMY_BOOTSTRAP_SERVERS, "--list"};
+        assertThrows(OptionException.class, () -> ConsumerGroupCommandOptions.fromArgs(cgcArgs));
+    }
+
+    private static Stream<Arguments> validConsumerGroupStates() {
+        return Stream.of(
+                Arguments.of("Stable", Set.of(GroupState.STABLE)),
+                Arguments.of("Stable, PreparingRebalance", Set.of(GroupState.STABLE, GroupState.PREPARING_REBALANCE)),
+                Arguments.of("Dead,CompletingRebalance,", Set.of(GroupState.DEAD, GroupState.COMPLETING_REBALANCE)),
+                Arguments.of("stable", Set.of(GroupState.STABLE)),
+                Arguments.of("stable, assigning", Set.of(GroupState.STABLE, GroupState.ASSIGNING)),
+                Arguments.of("dead,reconciling,", Set.of(GroupState.DEAD, GroupState.RECONCILING))
+        );
+    }
+
+    @ParameterizedTest
+    @MethodSource("validConsumerGroupStates")
+    public void testConsumerGroupStatesFromString(String input, Set<GroupState> expected) {
+        assertEquals(expected, ConsumerGroupCommand.groupStatesFromString(input));
+    }
+
+    @ParameterizedTest
+    @ValueSource(strings = {"bad, wrong", "  bad, Stable", "   ,   ,"})
+    public void testConsumerGroupStatesFromInvalidString(String input) {
+        assertThrows(IllegalArgumentException.class, () -> ConsumerGroupCommand.groupStatesFromString(input));
+    }
+
+    private static Stream<Arguments> validConsumerGroupTypes() {
+        return Stream.of(
+                Arguments.of("consumer", Set.of(GroupType.CONSUMER)),
+                Arguments.of("consumer, classic", Set.of(GroupType.CONSUMER, GroupType.CLASSIC)),
+                Arguments.of("Consumer, Classic", Set.of(GroupType.CONSUMER, GroupType.CLASSIC))
+        );
+    }
+
+    @ParameterizedTest
+    @MethodSource("validConsumerGroupTypes")
+    public void testConsumerGroupTypesFromString(String input, Set<GroupType> expected) {
+        assertEquals(expected, ConsumerGroupCommand.consumerGroupTypesFromString(input));
+    }
+
+    @ParameterizedTest
+    @ValueSource(strings = {"Share", "streams", "bad, wrong", "  bad, generic", "   ,   ,"})
+    public void testConsumerGroupTypesFromInvalidString(String input) {
+        assertThrows(IllegalArgumentException.class, () -> ConsumerGroupCommand.consumerGroupTypesFromString(input));
+    }
 }
diff --git a/tools/src/test/java/org/apache/kafka/tools/consumer/group/ListConsumerGroupTest.java b/tools/src/test/java/org/apache/kafka/tools/consumer/group/ListConsumerGroupTest.java
index 896ed067062..36cf8441bff 100644
--- a/tools/src/test/java/org/apache/kafka/tools/consumer/group/ListConsumerGroupTest.java
+++ b/tools/src/test/java/org/apache/kafka/tools/consumer/group/ListConsumerGroupTest.java
@@ -16,11 +16,9 @@
  */
 package org.apache.kafka.tools.consumer.group;
 
-import org.apache.kafka.clients.CommonClientConfigs;
 import org.apache.kafka.clients.admin.Admin;
 import org.apache.kafka.clients.admin.AdminClientConfig;
 import org.apache.kafka.clients.admin.GroupListing;
-import org.apache.kafka.clients.admin.NewTopic;
 import org.apache.kafka.clients.consumer.GroupProtocol;
 import org.apache.kafka.clients.consumer.KafkaConsumer;
 import org.apache.kafka.clients.consumer.RangeAssignor;
@@ -37,12 +35,8 @@ import org.apache.kafka.common.test.api.Type;
 import org.apache.kafka.test.TestUtils;
 import org.apache.kafka.tools.ToolsTestUtils;
 
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.Test;
-
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -53,8 +47,6 @@ import java.util.Optional;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicReference;
 
-import joptsimple.OptionException;
-
 import static org.apache.kafka.clients.consumer.ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG;
 import static org.apache.kafka.clients.consumer.ConsumerConfig.GROUP_ID_CONFIG;
 import static org.apache.kafka.clients.consumer.ConsumerConfig.GROUP_PROTOCOL_CONFIG;
@@ -66,6 +58,7 @@ import static org.apache.kafka.coordinator.group.GroupCoordinatorConfig.CONSUMER
 import static org.apache.kafka.coordinator.group.GroupCoordinatorConfig.GROUP_INITIAL_REBALANCE_DELAY_MS_CONFIG;
 import static org.apache.kafka.coordinator.group.GroupCoordinatorConfig.OFFSETS_TOPIC_PARTITIONS_CONFIG;
 import static org.apache.kafka.coordinator.group.GroupCoordinatorConfig.OFFSETS_TOPIC_REPLICATION_FACTOR_CONFIG;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 
 @ClusterTestDefaults(
     types = {Type.CO_KRAFT},
@@ -75,6 +68,8 @@ import static org.apache.kafka.coordinator.group.GroupCoordinatorConfig.OFFSETS_
         @ClusterConfigProperty(key = GROUP_INITIAL_REBALANCE_DELAY_MS_CONFIG, value = "1000"),
         @ClusterConfigProperty(key = CONSUMER_GROUP_HEARTBEAT_INTERVAL_MS_CONFIG, value = "500"),
         @ClusterConfigProperty(key = CONSUMER_GROUP_MIN_HEARTBEAT_INTERVAL_MS_CONFIG, value = "500"),
+        @ClusterConfigProperty(key = "log.initial.task.delay.ms", value = "100"),
+        @ClusterConfigProperty(key = "log.segment.delete.delay.ms", value = "1000"),
     }
 )
 public class ListConsumerGroupTest {
@@ -94,47 +89,43 @@ public class ListConsumerGroupTest {
 
     @ClusterTest
     public void testListConsumerGroupsWithoutFilters() throws Exception {
-        for (int i = 0; i < supportedGroupProtocols().size(); i++) {
-            GroupProtocol groupProtocol = supportedGroupProtocols().get(i);
+        List<GroupProtocol> groupProtocols = supportedGroupProtocols();
+        for (int i = 0; i < groupProtocols.size(); i++) {
+            GroupProtocol groupProtocol = groupProtocols.get(i);
             String topic = TOPIC_PREFIX + groupProtocol.name;
             String protocolGroup = PROTOCOL_GROUP_PREFIX + groupProtocol.name;
             String topicGroup = TOPIC_GROUP_PREFIX + i;
             String topicPartitionsGroup = TOPIC_PARTITIONS_GROUP_PREFIX + i;
-            createTopic(topic);
+            clusterInstance.createTopic(topic, 1, (short) 1);
 
             try (AutoCloseable topicPartitionsConsumerGroupExecutor = consumerGroupClosable(topicPartitionsGroup, Set.of(new TopicPartition(topic, 0)));
                  AutoCloseable topicConsumerGroupExecutor = consumerGroupClosable(GroupProtocol.CLASSIC, topicGroup, topic);
                  AutoCloseable protocolConsumerGroupExecutor = consumerGroupClosable(groupProtocol, protocolGroup, topic);
                  ConsumerGroupCommand.ConsumerGroupService service = getConsumerGroupService(new String[]{"--bootstrap-server", clusterInstance.bootstrapServers(), "--list"})
             ) {
-                Set<String> expectedGroups = set(List.of(topicPartitionsGroup, topicGroup, protocolGroup));
-                final AtomicReference<Set> foundGroups = new AtomicReference<>();
+                Set<String> expectedGroups = Set.of(topicPartitionsGroup, topicGroup, protocolGroup);
+                final AtomicReference<Set<String>> foundGroups = new AtomicReference<>();
 
                 TestUtils.waitForCondition(() -> {
-                    foundGroups.set(set(service.listConsumerGroups()));
+                    foundGroups.set(Set.copyOf(service.listConsumerGroups()));
                     return Objects.equals(expectedGroups, foundGroups.get());
                 }, () -> "Expected --list to show groups " + expectedGroups + ", but found " + foundGroups.get() + ".");
             }
 
-            removeConsumer(set(List.of(topicPartitionsGroup, topicGroup, protocolGroup)));
-            deleteTopic(topic);
+            deleteConsumerGroups(Set.of(topicPartitionsGroup, topicGroup, protocolGroup));
+            clusterInstance.deleteTopic(topic);
         }
     }
 
-    @ClusterTest
-    public void testListWithUnrecognizedNewConsumerOption() {
-        String[] cgcArgs = new String[]{"--new-consumer", "--bootstrap-server", clusterInstance.bootstrapServers(), "--list"};
-        Assertions.assertThrows(OptionException.class, () -> getConsumerGroupService(cgcArgs));
-    }
-
     @ClusterTest
     public void testListConsumerGroupsWithStates() throws Exception {
-        for (int i = 0; i < supportedGroupProtocols().size(); i++) {
-            GroupProtocol groupProtocol = supportedGroupProtocols().get(i);
+        List<GroupProtocol> groupProtocols = supportedGroupProtocols();
+        for (int i = 0; i < groupProtocols.size(); i++) {
+            GroupProtocol groupProtocol = groupProtocols.get(i);
             String topic = TOPIC_PREFIX + groupProtocol.name;
             String protocolGroup = PROTOCOL_GROUP_PREFIX + groupProtocol.name;
             String topicPartitionsGroup = TOPIC_PARTITIONS_GROUP_PREFIX + i;
-            createTopic(topic);
+            clusterInstance.createTopic(topic, 1, (short) 1);
 
             try (AutoCloseable topicPartitionsConsumerGroupExecutor = consumerGroupClosable(topicPartitionsGroup, Set.of(new TopicPartition(topic, 0)));
                  AutoCloseable protocolConsumerGroupExecutor = consumerGroupClosable(groupProtocol, protocolGroup, topic);
@@ -186,8 +177,8 @@ public class ListConsumerGroupTest {
                 );
             }
 
-            removeConsumer(set(List.of(topicPartitionsGroup, protocolGroup)));
-            deleteTopic(topic);
+            deleteConsumerGroups(Set.of(topicPartitionsGroup, protocolGroup));
+            clusterInstance.deleteTopic(topic);
         }
     }
 
@@ -197,7 +188,7 @@ public class ListConsumerGroupTest {
         String topic = TOPIC_PREFIX + groupProtocol.name;
         String protocolGroup = PROTOCOL_GROUP_PREFIX + groupProtocol.name;
         String topicPartitionsGroup = TOPIC_PARTITIONS_GROUP_PREFIX + "0";
-        createTopic(topic);
+        clusterInstance.createTopic(topic, 1, (short) 1);
 
         try (AutoCloseable topicPartitionsConsumerGroupExecutor = consumerGroupClosable(topicPartitionsGroup, Set.of(new TopicPartition(topic, 0)));
              AutoCloseable protocolConsumerGroupExecutor = consumerGroupClosable(groupProtocol, protocolGroup, topic);
@@ -252,7 +243,7 @@ public class ListConsumerGroupTest {
         String protocolGroup = PROTOCOL_GROUP_PREFIX + groupProtocol.name;
         String topicGroup = TOPIC_GROUP_PREFIX + "0";
         String topicPartitionsGroup = TOPIC_PARTITIONS_GROUP_PREFIX + "0";
-        createTopic(topic);
+        clusterInstance.createTopic(topic, 1, (short) 1);
 
         try (AutoCloseable topicPartitionsConsumerGroupExecutor = consumerGroupClosable(topicPartitionsGroup, Set.of(new TopicPartition(topic, 0)));
              AutoCloseable topicConsumerGroupExecutor = consumerGroupClosable(GroupProtocol.CLASSIC, topicGroup, topic);
@@ -338,7 +329,7 @@ public class ListConsumerGroupTest {
         String topic = TOPIC_PREFIX + groupProtocol.name;
         String protocolGroup = PROTOCOL_GROUP_PREFIX + groupProtocol.name;
         String topicPartitionsGroup = TOPIC_PARTITIONS_GROUP_PREFIX + "0";
-        createTopic(topic);
+        clusterInstance.createTopic(topic, 1, (short) 1);
 
         try (AutoCloseable topicPartitionsConsumerGroupExecutor = consumerGroupClosable(topicPartitionsGroup, Set.of(new TopicPartition(topic, 0)));
              AutoCloseable protocolConsumerGroupExecutor = consumerGroupClosable(groupProtocol, protocolGroup, topic)
@@ -423,7 +414,7 @@ public class ListConsumerGroupTest {
         String topic = TOPIC_PREFIX + groupProtocol.name;
         String protocolGroup = PROTOCOL_GROUP_PREFIX + groupProtocol.name;
         String topicPartitionsGroup = TOPIC_PARTITIONS_GROUP_PREFIX + "0";
-        createTopic(topic);
+        clusterInstance.createTopic(topic, 1, (short) 1);
 
         try (AutoCloseable topicPartitionsConsumerGroupExecutor = consumerGroupClosable(topicPartitionsGroup, Set.of(new TopicPartition(topic, 0)));
              AutoCloseable protocolConsumerGroupExecutor = consumerGroupClosable(groupProtocol, protocolGroup, topic)
@@ -483,11 +474,7 @@ public class ListConsumerGroupTest {
     }
 
     private AutoCloseable consumerGroupClosable(GroupProtocol protocol, String groupId, String topicName) {
-        Map<String, Object> configs = composeConfigs(
-                groupId,
-                protocol.name,
-                Map.of()
-        );
+        Map<String, Object> configs = composeConfigs(groupId, protocol.name);
 
         return ConsumerGroupCommandTestUtils.buildConsumers(
                 1,
@@ -498,11 +485,7 @@ public class ListConsumerGroupTest {
     }
 
     private AutoCloseable consumerGroupClosable(String groupId, Set<TopicPartition> topicPartitions) {
-        Map<String, Object> configs = composeConfigs(
-                groupId,
-                GroupProtocol.CLASSIC.name,
-                Map.of()
-        );
+        Map<String, Object> configs = composeConfigs(groupId, GroupProtocol.CLASSIC.name);
 
         return ConsumerGroupCommandTestUtils.buildConsumers(
                 1,
@@ -511,7 +494,7 @@ public class ListConsumerGroupTest {
         );
     }
 
-    private Map<String, Object> composeConfigs(String groupId, String groupProtocol, Map<String, Object> customConfigs) {
+    private Map<String, Object> composeConfigs(String groupId, String groupProtocol) {
         Map<String, Object> configs = new HashMap<>();
         configs.put(BOOTSTRAP_SERVERS_CONFIG, clusterInstance.bootstrapServers());
         configs.put(GROUP_ID_CONFIG, groupId);
@@ -521,36 +504,20 @@ public class ListConsumerGroupTest {
         if (GroupProtocol.CLASSIC.name.equalsIgnoreCase(groupProtocol)) {
             configs.put(PARTITION_ASSIGNMENT_STRATEGY_CONFIG, RangeAssignor.class.getName());
         }
-
-        configs.putAll(customConfigs);
         return configs;
     }
 
     private ConsumerGroupCommand.ConsumerGroupService getConsumerGroupService(String[] args) {
         ConsumerGroupCommandOptions opts = ConsumerGroupCommandOptions.fromArgs(args);
-        ConsumerGroupCommand.ConsumerGroupService service = new ConsumerGroupCommand.ConsumerGroupService(
+        return new ConsumerGroupCommand.ConsumerGroupService(
                 opts,
                 Map.of(AdminClientConfig.RETRIES_CONFIG, Integer.toString(Integer.MAX_VALUE))
         );
-
-        return service;
     }
 
-    private void createTopic(String topic) {
-        try (Admin admin = Admin.create(Map.of(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, clusterInstance.bootstrapServers()))) {
-            Assertions.assertDoesNotThrow(() -> admin.createTopics(List.of(new NewTopic(topic, 1, (short) 1))).topicId(topic).get());
-        }
-    }
-
-    private void deleteTopic(String topic) {
-        try (Admin admin = Admin.create(Map.of(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, clusterInstance.bootstrapServers()))) {
-            Assertions.assertDoesNotThrow(() -> admin.deleteTopics(Set.of(topic)).all().get());
-        }
-    }
-
-    private void removeConsumer(Set<String> groupIds) {
-        try (Admin admin = Admin.create(Map.of(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, clusterInstance.bootstrapServers()))) {
-            Assertions.assertDoesNotThrow(() -> admin.deleteConsumerGroups(groupIds).all().get());
+    private void deleteConsumerGroups(Set<String> groupIds) {
+        try (Admin admin = clusterInstance.admin()) {
+            assertDoesNotThrow(() -> admin.deleteConsumerGroups(groupIds).all().get());
         }
     }
 
@@ -570,8 +537,8 @@ public class ListConsumerGroupTest {
     ) throws Exception {
         final AtomicReference<Set<GroupListing>> foundListing = new AtomicReference<>();
         TestUtils.waitForCondition(() -> {
-            foundListing.set(set(service.listConsumerGroupsWithFilters(set(typeFilterSet), set(groupStateFilterSet))));
-            return Objects.equals(set(expectedListing), foundListing.get());
+            foundListing.set(new HashSet<>(service.listConsumerGroupsWithFilters(typeFilterSet, groupStateFilterSet)));
+            return Objects.equals(expectedListing, foundListing.get());
         }, () -> "Expected to show groups " + expectedListing + ", but found " + foundListing.get() + ".");
     }
 
@@ -615,58 +582,4 @@ public class ListConsumerGroupTest {
         }, () -> String.format("Expected header=%s and groups=%s, but found:%n%s", expectedHeader, expectedRows, out.get()));
     }
 
-    public static <T> Set<T> set(Collection<T> set) {
-        return new HashSet<>(set);
-    }
-}
-
-class ListConsumerGroupUnitTest {
-    @Test
-    public void testConsumerGroupStatesFromString() {
-        Set<GroupState> result = ConsumerGroupCommand.groupStatesFromString("Stable");
-        Assertions.assertEquals(ListConsumerGroupTest.set(Set.of(GroupState.STABLE)), result);
-
-        result = ConsumerGroupCommand.groupStatesFromString("Stable, PreparingRebalance");
-        Assertions.assertEquals(ListConsumerGroupTest.set(List.of(GroupState.STABLE, GroupState.PREPARING_REBALANCE)), result);
-
-        result = ConsumerGroupCommand.groupStatesFromString("Dead,CompletingRebalance,");
-        Assertions.assertEquals(ListConsumerGroupTest.set(List.of(GroupState.DEAD, GroupState.COMPLETING_REBALANCE)), result);
-
-        result = ConsumerGroupCommand.groupStatesFromString("stable");
-        Assertions.assertEquals(ListConsumerGroupTest.set(List.of(GroupState.STABLE)), result);
-
-        result = ConsumerGroupCommand.groupStatesFromString("stable, assigning");
-        Assertions.assertEquals(ListConsumerGroupTest.set(List.of(GroupState.STABLE, GroupState.ASSIGNING)), result);
-
-        result = ConsumerGroupCommand.groupStatesFromString("dead,reconciling,");
-        Assertions.assertEquals(ListConsumerGroupTest.set(List.of(GroupState.DEAD, GroupState.RECONCILING)), result);
-
-        Assertions.assertThrows(IllegalArgumentException.class, () -> ConsumerGroupCommand.groupStatesFromString("bad, wrong"));
-
-        Assertions.assertThrows(IllegalArgumentException.class, () -> ConsumerGroupCommand.groupStatesFromString("  bad, Stable"));
-
-        Assertions.assertThrows(IllegalArgumentException.class, () -> ConsumerGroupCommand.groupStatesFromString("   ,   ,"));
-    }
-
-    @Test
-    public void testConsumerGroupTypesFromString() {
-        Set<GroupType> result = ConsumerGroupCommand.consumerGroupTypesFromString("consumer");
-        Assertions.assertEquals(ListConsumerGroupTest.set(Set.of(GroupType.CONSUMER)), result);
-
-        result = ConsumerGroupCommand.consumerGroupTypesFromString("consumer, classic");
-        Assertions.assertEquals(ListConsumerGroupTest.set(List.of(GroupType.CONSUMER, GroupType.CLASSIC)), result);
-
-        result = ConsumerGroupCommand.consumerGroupTypesFromString("Consumer, Classic");
-        Assertions.assertEquals(ListConsumerGroupTest.set(List.of(GroupType.CONSUMER, GroupType.CLASSIC)), result);
-
-        Assertions.assertThrows(IllegalArgumentException.class, () -> ConsumerGroupCommand.consumerGroupTypesFromString("Share"));
-
-        Assertions.assertThrows(IllegalArgumentException.class, () -> ConsumerGroupCommand.consumerGroupTypesFromString("streams"));
-
-        Assertions.assertThrows(IllegalArgumentException.class, () -> ConsumerGroupCommand.consumerGroupTypesFromString("bad, wrong"));
-
-        Assertions.assertThrows(IllegalArgumentException.class, () -> ConsumerGroupCommand.consumerGroupTypesFromString("  bad, generic"));
-
-        Assertions.assertThrows(IllegalArgumentException.class, () -> ConsumerGroupCommand.consumerGroupTypesFromString("   ,   ,"));
-    }
 }