You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/07/20 10:00:12 UTC

[GitHub] [kafka] ijuma commented on a diff in pull request #12422: KAFKA-13982: Move WorkerConfigTransformerTest to use Mockito

ijuma commented on code in PR #12422:
URL: https://github.com/apache/kafka/pull/12422#discussion_r925416275


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerConfigTransformerTest.java:
##########
@@ -53,64 +50,72 @@ public class WorkerConfigTransformerTest {
     public static final String TEST_RESULT_WITH_TTL = "testResultWithTTL";
     public static final String TEST_RESULT_WITH_LONGER_TTL = "testResultWithLongerTTL";
 
-    @Mock private Herder herder;
-    @Mock private Worker worker;
-    @Mock private HerderRequest requestId;
+    private final Herder herder = Mockito.mock(Herder.class);
+    private final Worker worker = Mockito.mock(Worker.class);
+    private final HerderRequest requestId = Mockito.mock(HerderRequest.class);

Review Comment:
   Since we are in the process of migrating to JUnit 5, it's simpler if we don't rely on JUnit 4 specific features. It's fine to use the `mock` method, but please use static imports to make it more concise.



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org