chia7712 commented on code in PR #15679: URL: https://github.com/apache/kafka/pull/15679#discussion_r1557557116
########## tools/src/test/java/org/apache/kafka/tools/consumer/group/DeleteOffsetsConsumerGroupCommandIntegrationTest.java: ########## @@ -213,4 +234,8 @@ private Consumer<byte[], byte[]> createConsumer(Properties config) { return new KafkaConsumer<>(config); } + + private void createTopic(String topic) { + TestUtils.createTopicWithAdminRaw(clusterInstance.createAdminClient(), topic, 1, 1, scala.collection.immutable.Map$.MODULE$.empty(), new Properties()); Review Comment: Can we avoid using scala code here? ########## tools/src/test/java/org/apache/kafka/tools/consumer/group/DeleteOffsetsConsumerGroupCommandIntegrationTest.java: ########## @@ -42,19 +48,38 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; -public class DeleteOffsetsConsumerGroupCommandIntegrationTest extends ConsumerGroupCommandTest { +@Tag("integration") +@ClusterTestDefaults(clusterType = Type.ALL, brokers = 3) +@ExtendWith(ClusterTestExtensions.class) +public class DeleteOffsetsConsumerGroupCommandIntegrationTest { + private final ClusterInstance clusterInstance; + public static final String TOPIC = "foo"; + public static final String GROUP = "test.group"; + + DeleteOffsetsConsumerGroupCommandIntegrationTest(ClusterInstance clusterInstance) { // Constructor injections + this.clusterInstance = clusterInstance; + } + String[] getArgs(String group, String topic) { return new String[] { - "--bootstrap-server", bootstrapServers(listenerName()), + "--bootstrap-server", clusterInstance.bootstrapServers(), "--delete-offsets", "--group", group, "--topic", topic }; } - @ParameterizedTest - @ValueSource(strings = {"zk", "kraft"}) - public void testDeleteOffsetsNonExistingGroup(String quorum) { + ConsumerGroupCommand.ConsumerGroupService getConsumerGroupService(String[] args) { + ConsumerGroupCommandOptions opts = ConsumerGroupCommandOptions.fromArgs(args); + + return new ConsumerGroupCommand.ConsumerGroupService( + opts, + Collections.singletonMap(AdminClientConfig.RETRIES_CONFIG, Integer.toString(Integer.MAX_VALUE)) + ); + } + + @ClusterTest + public void testDeleteOffsetsNonExistingGroup() { String group = "missing.group"; String topic = "foo:1"; ConsumerGroupCommand.ConsumerGroupService service = getConsumerGroupService(getArgs(group, topic)); Review Comment: could you make sure all services get closed? -- 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