chia7712 commented on code in PR #16351:
URL: https://github.com/apache/kafka/pull/16351#discussion_r1641593418


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/ExactlyOnceWorkerSourceTaskTest.java:
##########
@@ -293,8 +287,10 @@ private void createWorkerTask(TargetState initialState, 
Converter keyConverter,
                 sourceConfig, Runnable::run, preProducerCheck, 
postProducerCheck, Collections::emptyList);
     }
 
-    @Test
-    public void testRemoveMetrics() {
+    @ParameterizedTest
+    @MethodSource("parameters")

Review Comment:
   Could you please use `@ValueSource(booleans = {true, false})` instead? that 
is more readable to me



##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/ExactlyOnceWorkerSourceTaskTest.java:
##########
@@ -333,8 +331,10 @@ public void testStartPaused() throws Exception {
         assertPollMetrics(0);
     }
 
-    @Test
-    public void testPause() throws Exception {
+    @ParameterizedTest
+    @MethodSource("parameters")

Review Comment:
   ditto



##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/ExactlyOnceWorkerSourceTaskTest.java:
##########
@@ -310,8 +306,10 @@ private Set<MetricName> 
filterToTaskMetrics(Set<MetricName> metricNames) {
                 .collect(Collectors.toSet());
     }
 
-    @Test
-    public void testStartPaused() throws Exception {
+    @ParameterizedTest
+    @MethodSource("parameters")

Review Comment:
   ditto



##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/ExactlyOnceWorkerSourceTaskTest.java:
##########
@@ -372,8 +372,10 @@ public void testPause() throws Exception {
         verifyCleanShutdown();
     }
 
-    @Test
-    public void testFailureInPreProducerCheck() throws Exception {
+    @ParameterizedTest
+    @MethodSource("parameters")

Review Comment:
   ditto



##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/ExactlyOnceWorkerSourceTaskTest.java:
##########
@@ -386,8 +388,10 @@ public void testFailureInPreProducerCheck() throws 
Exception {
         verifyShutdown(true, false);
     }
 
-    @Test
-    public void testFailureInProducerInitialization() throws Exception {
+    @ParameterizedTest

Review Comment:
   ditto



##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerSourceTaskTest.java:
##########
@@ -355,8 +353,10 @@ public void testPollsInBackground() throws Exception {
         verifyClose();
     }
 
-    @Test
-    public void testFailureInPoll() throws Exception {
+    @ParameterizedTest
+    @MethodSource("parameters")

Review Comment:
   ditto



##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerConnectorTest.java:
##########
@@ -429,8 +446,10 @@ public void testShutdownFailure() {
         verifyShutdown(false, true);
     }
 
-    @Test
-    public void testTransitionStartedToStarted() {
+    @ParameterizedTest
+    @MethodSource("parameters")

Review Comment:
   Could you please use `@EnumSource(value = ConnectorType.class, names = 
{"SOURCE", "SINK"})` instead? it is 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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to