m1a2st commented on code in PR #19464: URL: https://github.com/apache/kafka/pull/19464#discussion_r2044197885
########## streams/src/test/java/org/apache/kafka/streams/kstream/PrintedTest.java: ########## @@ -75,34 +74,34 @@ public void shouldCreateProcessorThatPrintsToFile() throws IOException { } @Test - public void shouldCreateProcessorThatPrintsToStdOut() throws UnsupportedEncodingException { + public void shouldCreateProcessorThatPrintsToStdOut() { final ProcessorSupplier<String, Integer, Void, Void> supplier = new PrintedInternal<>(sysOutPrinter).build("processor"); final Processor<String, Integer, Void, Void> processor = supplier.get(); processor.process(new Record<>("good", 2, 0L)); processor.close(); - assertThat(sysOut.toString(StandardCharsets.UTF_8.name()), equalTo("[processor]: good, 2\n")); + assertThat(sysOut.toString(StandardCharsets.UTF_8), equalTo("[processor]: good, 2\n")); Review Comment: We should use `assertEquals` instead of `assertThat` ########## streams/src/test/java/org/apache/kafka/streams/kstream/PrintedTest.java: ########## @@ -75,34 +74,34 @@ public void shouldCreateProcessorThatPrintsToFile() throws IOException { } @Test - public void shouldCreateProcessorThatPrintsToStdOut() throws UnsupportedEncodingException { + public void shouldCreateProcessorThatPrintsToStdOut() { final ProcessorSupplier<String, Integer, Void, Void> supplier = new PrintedInternal<>(sysOutPrinter).build("processor"); final Processor<String, Integer, Void, Void> processor = supplier.get(); processor.process(new Record<>("good", 2, 0L)); processor.close(); - assertThat(sysOut.toString(StandardCharsets.UTF_8.name()), equalTo("[processor]: good, 2\n")); + assertThat(sysOut.toString(StandardCharsets.UTF_8), equalTo("[processor]: good, 2\n")); } @Test - public void shouldPrintWithLabel() throws UnsupportedEncodingException { + public void shouldPrintWithLabel() { final Processor<String, Integer, Void, Void> processor = new PrintedInternal<>(sysOutPrinter.withLabel("label")) .build("processor") .get(); processor.process(new Record<>("hello", 3, 0L)); processor.close(); - assertThat(sysOut.toString(StandardCharsets.UTF_8.name()), equalTo("[label]: hello, 3\n")); + assertThat(sysOut.toString(StandardCharsets.UTF_8), equalTo("[label]: hello, 3\n")); Review Comment: ditto: We should use `assertEquals` instead of `assertThat` ########## streams/src/test/java/org/apache/kafka/streams/kstream/PrintedTest.java: ########## @@ -75,34 +74,34 @@ public void shouldCreateProcessorThatPrintsToFile() throws IOException { } @Test - public void shouldCreateProcessorThatPrintsToStdOut() throws UnsupportedEncodingException { + public void shouldCreateProcessorThatPrintsToStdOut() { final ProcessorSupplier<String, Integer, Void, Void> supplier = new PrintedInternal<>(sysOutPrinter).build("processor"); final Processor<String, Integer, Void, Void> processor = supplier.get(); processor.process(new Record<>("good", 2, 0L)); processor.close(); - assertThat(sysOut.toString(StandardCharsets.UTF_8.name()), equalTo("[processor]: good, 2\n")); + assertThat(sysOut.toString(StandardCharsets.UTF_8), equalTo("[processor]: good, 2\n")); } @Test - public void shouldPrintWithLabel() throws UnsupportedEncodingException { + public void shouldPrintWithLabel() { final Processor<String, Integer, Void, Void> processor = new PrintedInternal<>(sysOutPrinter.withLabel("label")) .build("processor") .get(); processor.process(new Record<>("hello", 3, 0L)); processor.close(); - assertThat(sysOut.toString(StandardCharsets.UTF_8.name()), equalTo("[label]: hello, 3\n")); + assertThat(sysOut.toString(StandardCharsets.UTF_8), equalTo("[label]: hello, 3\n")); } @Test - public void shouldPrintWithKeyValueMapper() throws UnsupportedEncodingException { + public void shouldPrintWithKeyValueMapper() { final Processor<String, Integer, Void, Void> processor = new PrintedInternal<>( sysOutPrinter.withKeyValueMapper((key, value) -> String.format("%s -> %d", key, value)) ).build("processor").get(); processor.process(new Record<>("hello", 1, 0L)); processor.close(); - assertThat(sysOut.toString(StandardCharsets.UTF_8.name()), equalTo("[processor]: hello -> 1\n")); + assertThat(sysOut.toString(StandardCharsets.UTF_8), equalTo("[processor]: hello -> 1\n")); Review Comment: ditto: We should use `assertEquals` instead of `assertThat` -- 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