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 all EventRouter behavior which all connectors should extend.
Author:
Chris Cranford
  • Field Details

    • outboxEventRouter

      protected EventRouter<org.apache.kafka.connect.source.SourceRecord> outboxEventRouter
  • Constructor Details

    • AbstractEventRouterTest

      public AbstractEventRouterTest()
  • Method Details

    • getConnectorClass

      protected abstract Class<T> getConnectorClass()
    • 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()
    • createTable

      protected abstract void createTable() throws Exception
      Throws:
      Exception
    • 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
    • beforeEach

      public void beforeEach() throws Exception
      Throws:
      Exception
    • afterEach

      public void afterEach() throws Exception
      Throws:
      Exception
    • 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()
    • getId

      protected Object getId(String idValue)
    • envelope

      private String envelope(String source, String destination)
    • header

      private String header(String source, String destination)
    • 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