mdedetrich commented on code in PR #12725:
URL: https://github.com/apache/kafka/pull/12725#discussion_r1003519590


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/rest/resources/ConnectorsResourceTest.java:
##########
@@ -547,118 +473,88 @@ public void testGetTasksConfig() throws Throwable {
         final Map<ConnectorTaskId, Map<String, String>> 
expectedTasksConnector2 = new HashMap<>();
         expectedTasksConnector2.put(connector2Task0, connector2Task0Configs);
 
-        final Capture<Callback<Map<ConnectorTaskId, Map<String, String>>>> cb1 
= Capture.newInstance();
-        herder.tasksConfig(EasyMock.eq(CONNECTOR_NAME), EasyMock.capture(cb1));
-        expectAndCallbackResult(cb1, expectedTasksConnector);
-        final Capture<Callback<Map<ConnectorTaskId, Map<String, String>>>> cb2 
= Capture.newInstance();
-        herder.tasksConfig(EasyMock.eq(CONNECTOR2_NAME), 
EasyMock.capture(cb2));
-        expectAndCallbackResult(cb2, expectedTasksConnector2);
-
-        PowerMock.replayAll();
+        final ArgumentCaptor<Callback<Map<ConnectorTaskId, Map<String, 
String>>>> cb1 = ArgumentCaptor.forClass(Callback.class);
+        expectAndCallbackResult(cb1, 
expectedTasksConnector).when(herder).tasksConfig(eq(CONNECTOR_NAME), 
cb1.capture());
+        final ArgumentCaptor<Callback<Map<ConnectorTaskId, Map<String, 
String>>>> cb2 = ArgumentCaptor.forClass(Callback.class);
+        expectAndCallbackResult(cb2, 
expectedTasksConnector2).when(herder).tasksConfig(eq(CONNECTOR2_NAME), 
cb2.capture());
 
         Map<ConnectorTaskId, Map<String, String>> tasksConfig = 
connectorsResource.getTasksConfig(CONNECTOR_NAME, NULL_HEADERS, FORWARD);
         assertEquals(expectedTasksConnector, tasksConfig);
         Map<ConnectorTaskId, Map<String, String>> tasksConfig2 = 
connectorsResource.getTasksConfig(CONNECTOR2_NAME, NULL_HEADERS, FORWARD);
         assertEquals(expectedTasksConnector2, tasksConfig2);
-
-        PowerMock.verifyAll();
     }
 
     @Test(expected = NotFoundException.class)
     public void testGetTasksConfigConnectorNotFound() throws Throwable {
-        final Capture<Callback<Map<ConnectorTaskId, Map<String, String>>>> cb 
= Capture.newInstance();
-        herder.tasksConfig(EasyMock.eq(CONNECTOR_NAME), EasyMock.capture(cb));
-        expectAndCallbackException(cb, new NotFoundException("not found"));
-
-        PowerMock.replayAll();
+        final ArgumentCaptor<Callback<Map<ConnectorTaskId, Map<String, 
String>>>> cb = ArgumentCaptor.forClass(Callback.class);
+        expectAndCallbackException(cb, new NotFoundException("not found"))
+            .when(herder).tasksConfig(eq(CONNECTOR_NAME), cb.capture());
 
         connectorsResource.getTasksConfig(CONNECTOR_NAME, NULL_HEADERS, 
FORWARD);

Review Comment:
   Done committed.



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

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

Reply via email to