cadonna commented on a change in pull request #11241: URL: https://github.com/apache/kafka/pull/11241#discussion_r696409669
########## File path: streams/src/test/java/org/apache/kafka/streams/kstream/internals/KStreamFlatMapTest.java ########## @@ -86,4 +88,12 @@ public void testFlatMap() { assertEquals(expected[i], supplier.theCapturedProcessor().processed().get(i)); } } + + @Test + public void testKeyValueMapperResultNotNull() { + final KStreamFlatMap<String, Integer, String, Integer> supplier = new KStreamFlatMap<>((key, value) -> null); + final Record<String, Integer> record = new Record<>("K", 0, 0L); + final Throwable throwable = assertThrows(NullPointerException.class, () -> supplier.get().process(record)); + assertEquals(throwable.getMessage(), String.format("KeyValueMapper can't return null from mapping the record: %s", record)); Review comment: In Streams, we use `hamcrest` because I think most of us find `assertThat()` more readable. I think other components do not use `hamcrest`. This is just a minor comment and it will not block the merge. Anyways, if you want to use `assertEquals()` you need to swap the parameters, since with `assertEquals()` the first parameter is the expected value and not the actual value. -- 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