bachmanity1 commented on code in PR #14410: URL: https://github.com/apache/kafka/pull/14410#discussion_r1331642481
########## streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamsProducerTest.java: ########## @@ -244,47 +247,41 @@ public void shouldCreateProducer() { @Test public void shouldForwardCallToPartitionsFor() { final List<PartitionInfo> expectedPartitionInfo = Collections.emptyList(); - expect(mockedProducer.partitionsFor("topic")).andReturn(expectedPartitionInfo); - replay(mockedProducer); + when(mockedProducer.partitionsFor(topic)).thenReturn(expectedPartitionInfo); final List<PartitionInfo> partitionInfo = streamsProducerWithMock.partitionsFor(topic); assertThat(partitionInfo, sameInstance(expectedPartitionInfo)); - verify(mockedProducer); + verify(mockedProducer).partitionsFor(topic); } @Test public void shouldForwardCallToFlush() { mockedProducer.flush(); Review Comment: I feel like here it's more natural to use verify instead of doNothing. -- 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