Class AbstractEventRouterTest<T extends org.apache.kafka.connect.source.SourceConnector>

  • 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 Detail

      • outboxEventRouter

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

      • AbstractEventRouterTest

        public AbstractEventRouterTest()
    • Method Detail

      • 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()
      • 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()
      • 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