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/09/23 16:37:54 UTC

[GitHub] [kafka] divijvaidya commented on a diff in pull request #12677: KAFKA-14132: Replace PowerMock/Easymock with Mockito for WorkerMetricsGroupTest

divijvaidya commented on code in PR #12677:
URL: https://github.com/apache/kafka/pull/12677#discussion_r978863704


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerMetricsGroupTest.java:
##########
@@ -55,24 +54,19 @@ public class WorkerMetricsGroupTest {
     private Sensor taskStartupSuccesses;
     private Sensor taskStartupFailures;
 
-    private ConnectorStatus.Listener delegateConnectorListener;
-    private TaskStatus.Listener delegateTaskListener;
+    @Mock private ConnectorStatus.Listener delegateConnectorListener;
+    @Mock private TaskStatus.Listener delegateTaskListener;
 
     @Before
     public void setup() {
-        connectMetrics = PowerMock.createMock(ConnectMetrics.class);
-        ConnectMetricsRegistry connectMetricsRegistry = PowerMock.createNiceMock(ConnectMetricsRegistry.class);
-        ConnectMetrics.MetricGroup metricGroup = PowerMock.createNiceMock(ConnectMetrics.MetricGroup.class);
+        ConnectMetricsRegistry connectMetricsRegistry = mock(ConnectMetricsRegistry.class);
+        ConnectMetrics.MetricGroup metricGroup = mock(ConnectMetrics.MetricGroup.class);
+        MetricName metricName = mock(MetricName.class);

Review Comment:
   Primarily to keep the PR code reviewer friendly :) by minimising the refactoring and doing in-place changes as much as possible. 
   
   I will move these to annotations in upcoming commit.



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