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


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/standalone/StandaloneHerderTest.java:
##########
@@ -226,59 +223,51 @@ public void testCreateConnectorAlreadyExists() throws 
Throwable {
 
     @Test
     public void testCreateSinkConnector() throws Exception {
-        connector = mock(BogusSinkConnector.class);
         expectAdd(SourceSink.SINK);
 
         Map<String, String> config = connectorConfig(SourceSink.SINK);
         Connector connectorMock = mock(SinkConnector.class);
-        expectConfigValidation(connectorMock, true, config);
+        expectConfigValidation(connectorMock, config);
 
         herder.putConnectorConfig(CONNECTOR_NAME, config, false, 
createCallback);
-        Herder.Created<ConnectorInfo> connectorInfo = 
createCallback.get(1000L, TimeUnit.SECONDS);
+        Herder.Created<ConnectorInfo> connectorInfo = 
createCallback.get(WAIT_TIME, TimeUnit.MILLISECONDS);
         assertEquals(createdInfo(SourceSink.SINK), connectorInfo.result());
     }
 
     @Test
     public void testCreateConnectorWithStoppedInitialState() throws Exception {
-        connector = mock(BogusSinkConnector.class);
         Map<String, String> config = connectorConfig(SourceSink.SINK);
         Connector connectorMock = mock(SinkConnector.class);
-        expectConfigValidation(connectorMock, false, config);
+        expectConfigValidation(connectorMock, config);
         when(plugins.newConnector(anyString())).thenReturn(connectorMock);

Review Comment:
   No, you did the right thing removing the `false` argument. I was just trying 
to say that it was a mistake that it was `false` instead of `true`, which broke 
the test, so the previous author added the line
   ```
   when(plugins.newConnector(anyString())).thenReturn(connectorMock);
   ```
   Now that the expectConfigValidation is mocking newConnector always, this 
test in the line is duplicated and can be removed.



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