NoOpConnectorFactory implements ConnectorFactory<NoOpConnectorFactory.NoOpConnector> { @Override public NoOpConnector createConnector(String connectorName, Properties config, String clusterName) { return new NoOpConnector(); }  @Override NoOpConnector createConnector(String connectorName, Properties config, String clusterName);  }
@Test public void testValidateUpdateDatastreams() throws Exception { Properties properties = new Properties(); NoOpConnectorFactory noOpConnectorFactory = new NoOpConnectorFactory(); NoOpConnectorFactory.NoOpConnector connector = noOpConnectorFactory.createConnector("noOpConnector", properties, "cluster"); Datastream datastream1 = createDatastream("noOp-1", "likafkakac"); Datastream datastream2 = createDatastream("noOp-2", "likafkakac"); connector.validateUpdateDatastreams(Arrays.asList(datastream1, datastream2), Arrays.asList(datastream1, datastream2)); Datastream datastream3 = createDatastream("noOp-2", "likafkakac"); datastream3.getSource().setConnectionString("source-blah"); try { connector.validateUpdateDatastreams(Arrays.asList(datastream1, datastream3), Arrays.asList(datastream1, datastream2)); Assert.fail(); } catch (DatastreamValidationException e) { } datastream3 = createDatastream("noOp-1", "likafkakac"); datastream3.getDestination().setConnectionString("dest-blah"); try { connector.validateUpdateDatastreams(Arrays.asList(datastream3, datastream2), Arrays.asList(datastream1, datastream2)); Assert.fail(); } catch (DatastreamValidationException e) { } datastream3 = createDatastream("noOp-2", "likafkakactest"); try { connector.validateUpdateDatastreams(Arrays.asList(datastream1, datastream3), Arrays.asList(datastream1, datastream2)); Assert.fail(); } catch (DatastreamValidationException e) { } datastream3 = createDatastream("noOp-1", "likafkakac"); datastream3.getMetadata().put("random-metadata-key", "random-metadata-value"); connector.validateUpdateDatastreams(Arrays.asList(datastream3, datastream2), Arrays.asList(datastream1, datastream2)); datastream2.getMetadata().put("metadata-key", "metadata-value"); datastream3 = createDatastream("noOp-2", "likafkakac"); datastream3.getMetadata().put("metadata-key", "new-metadata-value"); connector.validateUpdateDatastreams(Arrays.asList(datastream1, datastream3), Arrays.asList(datastream1, datastream2)); }