Search in sources :

Example 11 with StreamsResetter

use of kafka.tools.StreamsResetter in project kafka by apache.

the class ResetIntegrationTest method shouldNotAllowToResetWhenIntermediateTopicAbsent.

@Test
public void shouldNotAllowToResetWhenIntermediateTopicAbsent() {
    final String appID = IntegrationTestUtils.safeUniqueTestName(getClass(), testName);
    final String[] parameters = new String[] { "--application-id", appID, "--bootstrap-servers", cluster.bootstrapServers(), "--intermediate-topics", NON_EXISTING_TOPIC };
    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 int exitCode = new StreamsResetter().run(parameters, cleanUpConfig);
    Assert.assertEquals(1, exitCode);
}
Also used : StreamsResetter(kafka.tools.StreamsResetter) Properties(java.util.Properties) IntegrationTest(org.apache.kafka.test.IntegrationTest) Test(org.junit.Test)

Example 12 with StreamsResetter

use of kafka.tools.StreamsResetter in project kafka by apache.

the class ResetIntegrationTest method shouldNotAllowToResetWhenSpecifiedInternalTopicDoesNotExist.

@Test
public void shouldNotAllowToResetWhenSpecifiedInternalTopicDoesNotExist() {
    final String appID = IntegrationTestUtils.safeUniqueTestName(getClass(), testName);
    final String[] parameters = new String[] { "--application-id", appID, "--bootstrap-servers", cluster.bootstrapServers(), "--internal-topics", NON_EXISTING_TOPIC };
    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 int exitCode = new StreamsResetter().run(parameters, cleanUpConfig);
    Assert.assertEquals(1, exitCode);
}
Also used : StreamsResetter(kafka.tools.StreamsResetter) Properties(java.util.Properties) IntegrationTest(org.apache.kafka.test.IntegrationTest) Test(org.junit.Test)

Example 13 with StreamsResetter

use of kafka.tools.StreamsResetter in project kafka by apache.

the class ResetIntegrationTest method shouldNotAllowToResetWhenSpecifiedInternalTopicIsNotInternal.

@Test
public void shouldNotAllowToResetWhenSpecifiedInternalTopicIsNotInternal() {
    final String appID = IntegrationTestUtils.safeUniqueTestName(getClass(), testName);
    final String[] parameters = new String[] { "--application-id", appID, "--bootstrap-servers", cluster.bootstrapServers(), "--internal-topics", INPUT_TOPIC };
    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 int exitCode = new StreamsResetter().run(parameters, cleanUpConfig);
    Assert.assertEquals(1, exitCode);
}
Also used : StreamsResetter(kafka.tools.StreamsResetter) Properties(java.util.Properties) IntegrationTest(org.apache.kafka.test.IntegrationTest) Test(org.junit.Test)

Aggregations

StreamsResetter (kafka.tools.StreamsResetter)13 Properties (java.util.Properties)12 Test (org.junit.Test)6 IntegrationTest (org.apache.kafka.test.IntegrationTest)5 KafkaStreams (org.apache.kafka.streams.KafkaStreams)3 BufferedWriter (java.io.BufferedWriter)2 File (java.io.File)2 FileWriter (java.io.FileWriter)2 ArrayList (java.util.ArrayList)2 Date (java.util.Date)1 AdminClient (kafka.admin.AdminClient)1 KeyValue (org.apache.kafka.streams.KeyValue)1