Search in sources :

Example 1 with ConnectorConfiguration

use of org.apache.beam.io.debezium.DebeziumIO.ConnectorConfiguration in project beam by apache.

the class DebeziumIOTest method testSourceConnectorUsernamePassword.

@Test
public void testSourceConnectorUsernamePassword() {
    String username = "debezium";
    String password = "dbz";
    ConnectorConfiguration configuration = MYSQL_CONNECTOR_CONFIGURATION.withUsername(username).withPassword(password);
    Map<String, String> configurationMap = configuration.getConfigurationMap();
    Configuration debeziumConf = Configuration.from(configurationMap);
    Map<String, ConfigValue> validConfig = debeziumConf.validate(MySqlConnectorConfig.ALL_FIELDS);
    for (ConfigValue configValue : validConfig.values()) {
        assertTrue(configValue.errorMessages().isEmpty());
    }
}
Also used : ConfigValue(org.apache.kafka.common.config.ConfigValue) ConnectorConfiguration(org.apache.beam.io.debezium.DebeziumIO.ConnectorConfiguration) Configuration(io.debezium.config.Configuration) ConnectorConfiguration(org.apache.beam.io.debezium.DebeziumIO.ConnectorConfiguration) Test(org.junit.Test)

Aggregations

Configuration (io.debezium.config.Configuration)1 ConnectorConfiguration (org.apache.beam.io.debezium.DebeziumIO.ConnectorConfiguration)1 ConfigValue (org.apache.kafka.common.config.ConfigValue)1 Test (org.junit.Test)1