ijuma commented on a change in pull request #10852: URL: https://github.com/apache/kafka/pull/10852#discussion_r649169530
########## File path: log4j-appender/src/test/java/org/apache/kafka/log4jappender/KafkaLog4jAppenderTest.java ########## @@ -158,18 +160,18 @@ public void testRealProducerConfigWithSyncSendAndNotIgnoringExceptionsShouldThro assertThrows(RuntimeException.class, () -> logger.error(getMessage(0))); } + @SuppressWarnings("unchecked") private void replaceProducerWithMocked(MockKafkaLog4jAppender mockKafkaLog4jAppender, boolean success) { - MockProducer<byte[], byte[]> producer = EasyMock.niceMock(MockProducer.class); - Future<RecordMetadata> futureMock = EasyMock.niceMock(Future.class); + MockProducer<byte[], byte[]> producer = mock(MockProducer.class); + Future<RecordMetadata> futureMock = mock(Future.class); try { if (!success) - EasyMock.expect(futureMock.get()) - .andThrow(new ExecutionException("simulated timeout", new TimeoutException())); + Mockito.when(futureMock.get()) Review comment: Please use static imports to make this more readable. -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org