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

      • SimpleSourceConnectorOutputTest

        public SimpleSourceConnectorOutputTest()
    • Method Detail

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