Class AbstractJdbcSinkTest
java.lang.Object
io.debezium.connector.jdbc.integration.AbstractJdbcSinkTest
- Direct Known Subclasses:
AbstractJdbcSinkDeleteEnabledTest,AbstractJdbcSinkInsertModeTest,AbstractJdbcSinkPrimaryKeyModeTest,AbstractJdbcSinkSchemaEvolutionTest
Abstract JDBC Sink Connector integration test.
- Author:
- Chris Cranford
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DataSourceprivate static final org.slf4j.Loggerprivate final RandomTableNameGeneratorprivate final Sinkprivate io.debezium.connector.jdbc.JdbcSinkConnectorprivate org.apache.kafka.connect.sink.SinkTaskprivate final io.debezium.connector.jdbc.naming.TableNamingStrategy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidprotected voidConsumes the provided collection ofSinkRecordby the JDBC sink connector task.protected voidconsume(org.apache.kafka.connect.sink.SinkRecord record) Consumes the providedSinkRecordby the JDBC sink connector task.protected DataSourceReturns aDataSourceto access the sink connector's database instance started by the TestContainers framework.protected StringdestinationTableName(org.apache.kafka.connect.sink.SinkRecord record) Returns the default, basic sink connector configuration to talk to the database instance that was started by the TestContainers framework.protected SinkgetSink()protected StringReturns a random table name that can be used by the test.protected voidstartSinkConnector(Map<String, String> properties) Start the sink connector with the provided propertiesprotected voidStops the sink connector.protected StringReturns a constructed topic name based on the prefix, schema, and table names.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
sink
-
randomTableNameGenerator
-
tableNamingStrategy
private final io.debezium.connector.jdbc.naming.TableNamingStrategy tableNamingStrategy -
sinkConnector
private io.debezium.connector.jdbc.JdbcSinkConnector sinkConnector -
sinkTask
private org.apache.kafka.connect.sink.SinkTask sinkTask -
dataSource
-
-
Constructor Details
-
AbstractJdbcSinkTest
-
-
Method Details
-
afterEach
@AfterEach public void afterEach() -
getSink
-
getDefaultSinkConfig
Returns the default, basic sink connector configuration to talk to the database instance that was started by the TestContainers framework. -
getConfig
-
dataSource
Returns aDataSourceto access the sink connector's database instance started by the TestContainers framework. -
startSinkConnector
Start the sink connector with the provided properties- Parameters:
properties- the sink connector's configuration properties
-
stopSinkConnector
protected void stopSinkConnector()Stops the sink connector. -
consume
protected void consume(org.apache.kafka.connect.sink.SinkRecord record) Consumes the providedSinkRecordby the JDBC sink connector task. -
consume
Consumes the provided collection ofSinkRecordby the JDBC sink connector task. -
randomTableName
Returns a random table name that can be used by the test. -
destinationTableName
-
topicName
Returns a constructed topic name based on the prefix, schema, and table names. -
assertSinkConnectorIsRunning
protected void assertSinkConnectorIsRunning()
-