Preethi-Sundaravelu commented on code in PR #21826:
URL: https://github.com/apache/kafka/pull/21826#discussion_r3618742218
##########
tools/src/test/java/org/apache/kafka/tools/ResetIntegrationTest.java:
##########
@@ -226,6 +226,55 @@ public void
shouldNotAllowToResetWhenSpecifiedInternalTopicDoesNotExist(final Te
assertEquals(1, exitCode);
}
+ @Test
+ public void shouldFailWithErrorWhenApplicationIdDoesNotExist(final
TestInfo testInfo) {
+ final String nonExistentAppID = safeUniqueTestName(testInfo) +
"-does-not-exist";
+
+ final String[] parameters = new String[] {
+ "--application-id", nonExistentAppID,
+ "--bootstrap-server", cluster.bootstrapServers()
+ };
+ final Properties cleanUpConfig = new Properties();
+ cleanUpConfig.put(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, 100);
+ cleanUpConfig.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG,
Integer.toString(CLEANUP_CONSUMER_TIMEOUT));
+
+ final String errorOutput = ToolsTestUtils.captureStandardErr(() -> {
+ final int exitCode = new StreamsResetter().execute(parameters,
cleanUpConfig);
+ assertEquals(1, exitCode);
+ });
+
+ assertTrue(errorOutput.contains(nonExistentAppID));
+ assertTrue(errorOutput.contains("--force"));
+ assertTrue(errorOutput.contains("Refusing to delete internal topics"));
+ }
+
+ @Test
+ public void shouldSucceedWhenApplicationIdExistsAsConsumerGroup(final
TestInfo testInfo) throws Exception {
Review Comment:
Test cases are added for this scenario.
--
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]