jnh5y commented on code in PR #12161: URL: https://github.com/apache/kafka/pull/12161#discussion_r880907800
########## streams/src/test/java/org/apache/kafka/streams/KafkaStreamsTest.java: ########## @@ -783,6 +822,28 @@ public void shouldThrowOnCleanupWhileRunning() throws InterruptedException { } } + @Test + public void shouldThrowOnCleanupWhilePaused() throws InterruptedException { + try (final KafkaStreams streams = new KafkaStreams(getBuilderWithSource().build(), props, supplier, time)) { + streams.start(); + waitForCondition( + () -> streams.state() == KafkaStreams.State.RUNNING, + "Streams never started."); + + streams.pause(); + waitForCondition( + streams::isPaused, + "Streams did not paused"); + + try { + streams.cleanUp(); + fail("Should have thrown IllegalStateException"); + } catch (final IllegalStateException expected) { + assertEquals("Cannot clean up while running.", expected.getMessage()); + } Review Comment: I'll admit to it; I just copy-pasted the test directly above: https://github.com/apache/kafka/blob/34ec8ac54ac52196bccace8054cd7784719bf409/streams/src/test/java/org/apache/kafka/streams/KafkaStreamsTest.java#L816-L821 Is following the existing codebase ok or shall I spend some time to clean it up? -- 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