PatrickRen commented on code in PR #20205:
URL: https://github.com/apache/flink/pull/20205#discussion_r917610468


##########
flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/connector/kafka/sink/KafkaCommitterTest.java:
##########
@@ -85,6 +87,26 @@ public void testFailJobOnUnknownFatalError() throws 
IOException, InterruptedExce
         }
     }
 
+    @Test
+    public void testKafkaCommitterClosesProducer() throws IOException, 
InterruptedException {
+        Properties properties = getProperties();
+        FlinkKafkaInternalProducer<Object, Object> producer =
+                mock(FlinkKafkaInternalProducer.class);

Review Comment:
   Unfortunately we are not allowed to use Mockito according to the [code style 
guide](https://flink.apache.org/contributing/code-style-and-quality-common.html#avoid-mockito---use-reusable-test-implementations).
 
   
   The best alternative would be having a fully functioned 
`MockFlinkKafkaInternalProducer` similar to `MockProducer` provided by Kafka, 
but I'm OK just having an anonymous class extending the 
`FlinkKafkaInternalProducer`  and overriding the `commitTransaction` method for 
now.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to