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


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/standalone/StandaloneHerderTest.java:
##########
@@ -319,35 +318,28 @@ public void testRestartConnectorNewTaskConfigs() throws 
Exception {
 
         Map<String, String> config = connectorConfig(SourceSink.SOURCE);
         ConnectorTaskId taskId = new ConnectorTaskId(CONNECTOR_NAME, 0);
-        Connector connectorMock = PowerMock.createMock(SourceConnector.class);
+        Connector connectorMock = mock(SourceConnector.class);
         expectConfigValidation(connectorMock, true, config);
 
         worker.stopAndAwaitConnector(CONNECTOR_NAME);
-        EasyMock.expectLastCall();
+        doNothing().when(worker).stopAndAwaitConnector(CONNECTOR_NAME);

Review Comment:
   Removing `verify(worker).stopAndAwaitConnector(CONNECTOR_NAME)` here causes 
the test to fail with 
   
   ```
   worker.stopAndAwaitConnector("test");
   Wanted 1 time:
   -> at 
org.apache.kafka.connect.runtime.Worker.stopAndAwaitConnector(Worker.java:500)
   But was 2 times:
   -> at 
org.apache.kafka.connect.runtime.standalone.StandaloneHerderTest.testRestartConnectorNewTaskConfigs(StandaloneHerderTest.java:318)
   -> at 
org.apache.kafka.connect.runtime.standalone.StandaloneHerder.restartConnector(StandaloneHerder.java:295)
   ```
   



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