ahmedsobeh commented on code in PR #15389:
URL: https://github.com/apache/kafka/pull/15389#discussion_r1523007035


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/standalone/StandaloneHerderTest.java:
##########
@@ -773,40 +730,34 @@ public void testPutConnectorConfig() throws Exception {
         Callback<Map<String, String>> connectorConfigCb = mock(Callback.class);
 
         // Create
-        connector = mock(BogusSourceConnector.class);
         expectAdd(SourceSink.SOURCE);
         Connector connectorMock = mock(SourceConnector.class);
-        expectConfigValidation(connectorMock, true, connConfig);
+        expectConfigValidation(connectorMock, connConfig);
 
         // Should get first config
         doNothing().when(connectorConfigCb).onCompletion(null, connConfig);
         // Update config, which requires stopping and restarting
         doNothing().when(worker).stopAndAwaitConnector(CONNECTOR_NAME);
         final ArgumentCaptor<Map<String, String>> capturedConfig = 
ArgumentCaptor.forClass(Map.class);
-        final ArgumentCaptor<Callback<TargetState>> onStart = 
ArgumentCaptor.forClass(Callback.class);
-        doAnswer(invocation -> {
-            onStart.getValue().onCompletion(null, TargetState.STARTED);
-            return true;
-        }).when(worker).startConnector(eq(CONNECTOR_NAME), 
capturedConfig.capture(), any(),
-            eq(herder), eq(TargetState.STARTED), onStart.capture());
+        mockStartConnector(null, capturedConfig, TargetState.STARTED, 
TargetState.STARTED, null);

Review Comment:
   I use the value of captured config to determine whether to call any() or 
any(HerderConnectorContext.class), is there anything else to decide based on?



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