Search in sources :

Example 21 with Plugins

use of org.apache.kafka.connect.runtime.isolation.Plugins in project apache-kafka-on-k8s by banzaicloud.

the class TransformationConfigTest method testEmbeddedConfigSetSchemaMetadata.

@Test
public void testEmbeddedConfigSetSchemaMetadata() {
    // Validate that we can construct a Connector config containing the extended config for the transform
    HashMap<String, String> connProps = new HashMap<>();
    connProps.put("name", "foo");
    connProps.put("connector.class", MockConnector.class.getName());
    connProps.put("transforms", "example");
    connProps.put("transforms.example.type", SetSchemaMetadata.Value.class.getName());
    // Safe when we're only constructing the config
    Plugins plugins = null;
    new ConnectorConfig(plugins, connProps);
}
Also used : HashMap(java.util.HashMap) MockConnector(org.apache.kafka.connect.tools.MockConnector) Plugins(org.apache.kafka.connect.runtime.isolation.Plugins) Test(org.junit.Test)

Example 22 with Plugins

use of org.apache.kafka.connect.runtime.isolation.Plugins in project apache-kafka-on-k8s by banzaicloud.

the class TransformationConfigTest method testEmbeddedConfigReplaceField.

@Test
public void testEmbeddedConfigReplaceField() {
    // Validate that we can construct a Connector config containing the extended config for the transform
    HashMap<String, String> connProps = new HashMap<>();
    connProps.put("name", "foo");
    connProps.put("connector.class", MockConnector.class.getName());
    connProps.put("transforms", "example");
    connProps.put("transforms.example.type", ReplaceField.Value.class.getName());
    // Safe when we're only constructing the config
    Plugins plugins = null;
    new ConnectorConfig(plugins, connProps);
}
Also used : HashMap(java.util.HashMap) MockConnector(org.apache.kafka.connect.tools.MockConnector) Plugins(org.apache.kafka.connect.runtime.isolation.Plugins) Test(org.junit.Test)

Example 23 with Plugins

use of org.apache.kafka.connect.runtime.isolation.Plugins in project apache-kafka-on-k8s by banzaicloud.

the class TransformationConfigTest method testEmbeddedConfigMaskField.

@Test
public void testEmbeddedConfigMaskField() {
    // Validate that we can construct a Connector config containing the extended config for the transform
    HashMap<String, String> connProps = new HashMap<>();
    connProps.put("name", "foo");
    connProps.put("connector.class", MockConnector.class.getName());
    connProps.put("transforms", "example");
    connProps.put("transforms.example.type", MaskField.Value.class.getName());
    connProps.put("transforms.example.fields", "field");
    // Safe when we're only constructing the config
    Plugins plugins = null;
    new ConnectorConfig(plugins, connProps);
}
Also used : HashMap(java.util.HashMap) MockConnector(org.apache.kafka.connect.tools.MockConnector) Plugins(org.apache.kafka.connect.runtime.isolation.Plugins) Test(org.junit.Test)

Example 24 with Plugins

use of org.apache.kafka.connect.runtime.isolation.Plugins in project apache-kafka-on-k8s by banzaicloud.

the class TransformationConfigTest method testEmbeddedConfigTimestampConverter.

@Test
public void testEmbeddedConfigTimestampConverter() {
    // Validate that we can construct a Connector config containing the extended config for the transform
    HashMap<String, String> connProps = new HashMap<>();
    connProps.put("name", "foo");
    connProps.put("connector.class", MockConnector.class.getName());
    connProps.put("transforms", "example");
    connProps.put("transforms.example.type", TimestampConverter.Value.class.getName());
    connProps.put("transforms.example.target.type", "unix");
    // Safe when we're only constructing the config
    Plugins plugins = null;
    new ConnectorConfig(plugins, connProps);
}
Also used : HashMap(java.util.HashMap) MockConnector(org.apache.kafka.connect.tools.MockConnector) Plugins(org.apache.kafka.connect.runtime.isolation.Plugins) Test(org.junit.Test)

Example 25 with Plugins

use of org.apache.kafka.connect.runtime.isolation.Plugins in project apache-kafka-on-k8s by banzaicloud.

the class TransformationConfigTest method testEmbeddedConfigInsertField.

@Test
public void testEmbeddedConfigInsertField() {
    // Validate that we can construct a Connector config containing the extended config for the transform
    HashMap<String, String> connProps = new HashMap<>();
    connProps.put("name", "foo");
    connProps.put("connector.class", MockConnector.class.getName());
    connProps.put("transforms", "example");
    connProps.put("transforms.example.type", InsertField.Value.class.getName());
    // Safe when we're only constructing the config
    Plugins plugins = null;
    new ConnectorConfig(plugins, connProps);
}
Also used : HashMap(java.util.HashMap) MockConnector(org.apache.kafka.connect.tools.MockConnector) Plugins(org.apache.kafka.connect.runtime.isolation.Plugins) Test(org.junit.Test)

Aggregations

Plugins (org.apache.kafka.connect.runtime.isolation.Plugins)34 HashMap (java.util.HashMap)27 MockConnector (org.apache.kafka.connect.tools.MockConnector)24 Test (org.junit.Test)24 Worker (org.apache.kafka.connect.runtime.Worker)7 URI (java.net.URI)4 Connect (org.apache.kafka.connect.runtime.Connect)4 RestServer (org.apache.kafka.connect.runtime.rest.RestServer)4 DistributedConfig (org.apache.kafka.connect.runtime.distributed.DistributedConfig)3 DistributedHerder (org.apache.kafka.connect.runtime.distributed.DistributedHerder)3 StandaloneConfig (org.apache.kafka.connect.runtime.standalone.StandaloneConfig)3 ConfigBackingStore (org.apache.kafka.connect.storage.ConfigBackingStore)3 Converter (org.apache.kafka.connect.storage.Converter)3 KafkaConfigBackingStore (org.apache.kafka.connect.storage.KafkaConfigBackingStore)3 KafkaOffsetBackingStore (org.apache.kafka.connect.storage.KafkaOffsetBackingStore)3 KafkaStatusBackingStore (org.apache.kafka.connect.storage.KafkaStatusBackingStore)3 StatusBackingStore (org.apache.kafka.connect.storage.StatusBackingStore)3 MockTime (org.apache.kafka.common.utils.MockTime)2 Time (org.apache.kafka.common.utils.Time)2 Herder (org.apache.kafka.connect.runtime.Herder)2