Class SimpleSourceConnectorOutputTest

java.lang.Object
io.debezium.embedded.ConnectorOutputTest
io.debezium.connector.simple.SimpleSourceConnectorOutputTest

public class SimpleSourceConnectorOutputTest extends ConnectorOutputTest
A test case for the SimpleSourceConnector that is also able to test and verify the behavior of ConnectorOutputTest.
Author:
Randall Hauch
  • Field Details

  • Constructor Details

    • SimpleSourceConnectorOutputTest

      public SimpleSourceConnectorOutputTest()
  • Method Details

    • shouldGenerateExpected

      public void shouldGenerateExpected() throws Exception
      Run the connector with no known expected results so that it generates the results.
      Throws:
      Exception - if there is an error
    • shouldRunConnectorFromFilesInOneStep

      public void shouldRunConnectorFromFilesInOneStep()
      Run the connector with connector configuration and expected results files, which are read in one step.
    • shouldRunConnectorFromFilesInTwoSteps

      public void shouldRunConnectorFromFilesInTwoSteps()
      Run the connector with connector configuration and expected results files, which are read in two steps.
    • shouldRunConnectorFromFilesAndFindMismatch

      public void shouldRunConnectorFromFilesAndFindMismatch()
      Run the connector with connector configuration and expected results files, but find a mismatch in the results.
    • shouldRunConnectorFromFilesInOneStepWithTimestamps

      public void shouldRunConnectorFromFilesInOneStepWithTimestamps()
      Run the connector with connector configuration and expected results files, which are read in one step. The connector includes timestamps that vary with each run, and the expected results have no no timestamps. However, this test filters out the timestamps from the matching logic.
    • shouldRecoverFromRetriableException

      public void shouldRecoverFromRetriableException()
      Run the connector and verify that RetriableException is handled.
    • shouldRecoverFromRetriableExceptionMaxRetriesIs1

      public void shouldRecoverFromRetriableExceptionMaxRetriesIs1()
    • shouldRecoverFromRetriableExceptionMaxRetriesIsNegative1

      public void shouldRecoverFromRetriableExceptionMaxRetriesIsNegative1()
    • writeConfigurationFileWithDefaultName

      protected void writeConfigurationFileWithDefaultName(Path dir, Properties props) throws IOException
      Throws:
      IOException
    • writeEnvironmentFileWithDefaultName

      protected void writeEnvironmentFileWithDefaultName(Path dir, Properties props) throws IOException
      Throws:
      IOException
    • writeConfigurationFile

      protected void writeConfigurationFile(Path configFilePath, Properties props) throws IOException
      Throws:
      IOException
    • readConfiguration

      protected Properties readConfiguration(Path configFilePath) throws IOException
      Throws:
      IOException
    • appendStop

      protected void appendStop(Path results) throws IOException
      Throws:
      IOException
    • readResults

      protected Array readResults(File file) throws IOException
      Throws:
      IOException
    • appendCommand

      protected void appendCommand(Path results, Document command) throws IOException
      Throws:
      IOException
    • assertExpectedRecords

      protected void assertExpectedRecords(Path path, int batchCount, int recordsPerBatch) throws IOException
      Throws:
      IOException
    • assertFieldSchema

      protected void assertFieldSchema(Document doc, String fieldName, org.apache.kafka.connect.data.Schema.Type type, boolean optional)
    • assertRequiredFieldSchema

      protected void assertRequiredFieldSchema(Document doc, String fieldName, org.apache.kafka.connect.data.Schema.Type type)
    • assertOptionalFieldSchema

      protected void assertOptionalFieldSchema(Document doc, String fieldName, org.apache.kafka.connect.data.Schema.Type type)