dengziming commented on a change in pull request #10852:
URL: https://github.com/apache/kafka/pull/10852#discussion_r650319455



##########
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")

Review comment:
       Thank you, Done!

##########
File path: 
log4j-appender/src/test/java/org/apache/kafka/log4jappender/KafkaLog4jAppenderTest.java
##########
@@ -159,17 +161,18 @@ public void 
testRealProducerConfigWithSyncSendAndNotIgnoringExceptionsShouldThro
     }
 
     private void replaceProducerWithMocked(MockKafkaLog4jAppender 
mockKafkaLog4jAppender, boolean success) {
-        MockProducer<byte[], byte[]> producer = 
EasyMock.niceMock(MockProducer.class);
-        Future<RecordMetadata> futureMock = EasyMock.niceMock(Future.class);
+        @SuppressWarnings("unchecked")
+        MockProducer<byte[], byte[]> producer = mock(MockProducer.class);
+        @SuppressWarnings("unchecked")
+        Future<RecordMetadata> futureMock = mock(Future.class);
         try {
             if (!success)
-                EasyMock.expect(futureMock.get())
-                    .andThrow(new ExecutionException("simulated timeout", new 
TimeoutException()));
+                when(futureMock.get())
+                        .thenThrow(new ExecutionException("simulated timeout", 
new TimeoutException()));
         } catch (InterruptedException | ExecutionException e) {

Review comment:
       Thank you for your reminder @chia7712 , Done!




-- 
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


Reply via email to