Package io.debezium.transforms.outbox
Class AbstractEventRouterTest<T extends org.apache.kafka.connect.source.SourceConnector>
- java.lang.Object
-
- io.debezium.embedded.AbstractConnectorTest
-
- io.debezium.transforms.outbox.AbstractEventRouterTest<T>
-
- All Implemented Interfaces:
Testing
public abstract class AbstractEventRouterTest<T extends org.apache.kafka.connect.source.SourceConnector> extends AbstractConnectorTest
A unified test of allEventRouterbehavior which all connectors should extend.- Author:
- Chris Cranford
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.debezium.embedded.AbstractConnectorTest
AbstractConnectorTest.SourceRecords
-
Nested classes/interfaces inherited from interface io.debezium.util.Testing
Testing.Debug, Testing.Files, Testing.InterruptableFunction, Testing.Network, Testing.Print, Testing.Timer
-
-
Field Summary
Fields Modifier and Type Field Description protected EventRouter<org.apache.kafka.connect.source.SourceRecord>outboxEventRouter-
Fields inherited from class io.debezium.embedded.AbstractConnectorTest
engine, logger, logTestName, OFFSET_STORE_PATH, pollTimeoutInMs, skipTestRule
-
-
Constructor Summary
Constructors Constructor Description AbstractEventRouterTest()
-
Method Summary
-
Methods inherited from class io.debezium.embedded.AbstractConnectorTest
assertBeginTransaction, assertConfigurationErrors, assertConfigurationErrors, assertConfigurationErrors, assertConnectorIsRunning, assertConnectorNotRunning, assertDelete, assertEndTransaction, assertEngineIsRunning, assertHasNoSourceQuery, assertInsert, assertKey, assertNoConfigurationErrors, assertNoRecordsToConsume, assertOffset, assertOffset, assertOnlyTransactionRecordsToConsume, assertRecordTransactionMetadata, assertSchemaMatchesStruct, assertSchemaMatchesStruct, assertSourceQuery, assertTombstone, assertTombstone, assertUpdate, assertValueField, configValue, consumeAvailableRecords, consumeDmlRecordsByTopic, consumeDmlRecordsByTopic, consumeDmlRecordsByTopic, consumeRecord, consumeRecords, consumeRecords, consumeRecords, consumeRecordsByTopic, consumeRecordsByTopic, consumeRecordsByTopic, debug, getMaximumEnqueuedRecordCount, getSnapshotMetricsObjectName, getStreamingMetricsObjectName, getStreamingMetricsObjectName, getStreamingNamespace, initializeConnectorTestFramework, isStreamingRunning, isStreamingRunning, isTransactionRecord, loggingCompletion, print, readLastCommittedOffset, readLastCommittedOffsets, setConsumeTimeout, skipAvroValidation, start, start, start, start, start, startAndConsumeTillEnd, startAndConsumeTillEnd, stopConnector, stopConnector, validate, waitForAvailableRecords, waitForConnectorShutdown, waitForSnapshotToBeCompleted, waitForStreamingRunning, waitForStreamingRunning, waitTimeForRecords, waitTimeForRecordsAfterNulls
-
-
-
-
Field Detail
-
outboxEventRouter
protected EventRouter<org.apache.kafka.connect.source.SourceRecord> outboxEventRouter
-
-
Method Detail
-
databaseConnection
protected abstract JdbcConnection databaseConnection()
-
getConfigurationBuilder
protected abstract Configuration.Builder getConfigurationBuilder(boolean initialSnapshot)
-
topicName
protected abstract String topicName()
-
tableName
protected abstract String tableName()
-
getSchemaNamePrefix
protected abstract String getSchemaNamePrefix()
-
getPayloadSchema
protected abstract org.apache.kafka.connect.data.Schema getPayloadSchema()
-
alterTableWithExtra4Fields
protected abstract void alterTableWithExtra4Fields() throws Exception- Throws:
Exception
-
alterTableWithTimestampField
protected abstract void alterTableWithTimestampField() throws Exception- Throws:
Exception
-
alterTableModifyPayload
protected abstract void alterTableModifyPayload() throws Exception- Throws:
Exception
-
getAdditionalFieldValues
protected abstract String getAdditionalFieldValues(boolean deleted)
-
getAdditionalFieldValuesTimestampOnly
protected abstract String getAdditionalFieldValuesTimestampOnly()
-
createInsert
protected abstract String createInsert(String eventId, String eventType, String aggregateType, String aggregateId, String payloadJson, String additional)
-
waitForSnapshotCompleted
protected abstract void waitForSnapshotCompleted() throws InterruptedException- Throws:
InterruptedException
-
waitForStreamingStarted
protected abstract void waitForStreamingStarted() throws InterruptedException- Throws:
InterruptedException
-
shouldConsumeRecordsFromInsert
@FixFor({"DBZ-1169","DBZ-3940"}) public void shouldConsumeRecordsFromInsert() throws Exception
- Throws:
Exception
-
shouldSendEventTypeAsHeader
@FixFor({"DBZ-1385","DBZ-3940"}) public void shouldSendEventTypeAsHeader() throws Exception
- Throws:
Exception
-
shouldSendEventTypeAsValue
@FixFor({"DBZ-2014","DBZ-3940"}) public void shouldSendEventTypeAsValue() throws Exception
- Throws:
Exception
-
shouldRespectJsonFormatAsString
@FixFor({"DBZ-2014","DBZ-3940"}) public void shouldRespectJsonFormatAsString() throws Exception
- Throws:
Exception
-
shouldSupportAllFeatures
@FixFor({"DBZ-1169","DBZ-3940"}) public void shouldSupportAllFeatures() throws Exception
- Throws:
Exception
-
shouldConvertMicrosecondsTimestampToMilliseconds
@FixFor({"DBZ-1707","DBZ-3940"}) public void shouldConvertMicrosecondsTimestampToMilliseconds() throws Exception
- Throws:
Exception
-
shouldNotProduceTombstoneEventForNullPayload
@FixFor({"DBZ-1320","DBZ-3940"}) public void shouldNotProduceTombstoneEventForNullPayload() throws Exception
- Throws:
Exception
-
shouldProduceTombstoneEventForNullPayload
@FixFor({"DBZ-1320","DBZ-3940"}) public void shouldProduceTombstoneEventForNullPayload() throws Exception
- Throws:
Exception
-
shouldProduceTombstoneEventForEmptyPayload
@FixFor({"DBZ-1320","DBZ-3940"}) public void shouldProduceTombstoneEventForEmptyPayload() throws Exception
- Throws:
Exception
-
getFieldEventType
protected String getFieldEventType()
-
getFieldSchemaVersion
protected String getFieldSchemaVersion()
-
getFieldEventTimestamp
protected String getFieldEventTimestamp()
-
getFieldAggregateType
protected String getFieldAggregateType()
-
getSomeBoolType
protected String getSomeBoolType()
-
getIsDeleted
protected String getIsDeleted()
-
getIdSchema
protected org.apache.kafka.connect.data.Schema getIdSchema()
-
startConnectorWithInitialSnapshotRecord
private void startConnectorWithInitialSnapshotRecord() throws Exception- Throws:
Exception
-
startConnectorWithNoSnapshot
private void startConnectorWithNoSnapshot() throws Exception- Throws:
Exception
-
doInsert
private void doInsert(String insertSql) throws SQLException
- Throws:
SQLException
-
-