Package io.debezium.connector.simple
Class SimpleSourceConnectorOutputTest
java.lang.Object
io.debezium.embedded.ConnectorOutputTest
io.debezium.connector.simple.SimpleSourceConnectorOutputTest
A test case for the
SimpleSourceConnector that is also able to test and verify the behavior of
ConnectorOutputTest.- Author:
- Randall Hauch
-
Nested Class Summary
Nested classes/interfaces inherited from class io.debezium.embedded.ConnectorOutputTest
ConnectorOutputTest.InputStreamSupplier, ConnectorOutputTest.OutputStreamSupplier, ConnectorOutputTest.TestData, ConnectorOutputTest.TestSpecification, ConnectorOutputTest.VariableSupplier -
Field Summary
FieldsFields inherited from class io.debezium.embedded.ConnectorOutputTest
CONNECTOR_OUTPUT_PATH, CONTROL_END, CONTROL_KEY, CONTROL_RESTART, CONTROL_STOP, DEFAULT_CONNECTOR_PROPERTIES_FILENAME, DEFAULT_ENV_PROPERTIES_FILENAME, DEFAULT_EXPECTED_RECORDS_FILENAME, ENV_CONNECTOR_TIMEOUT_IN_SECONDS, ENV_IGNORE_FIELDS, OFFSET_STORE_PATH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendCommand(Path results, Document command) protected voidappendStop(Path results) protected voidassertExpectedRecords(Path path, int batchCount, int recordsPerBatch) protected voidassertFieldSchema(Document doc, String fieldName, org.apache.kafka.connect.data.Schema.Type type, boolean optional) protected voidassertOptionalFieldSchema(Document doc, String fieldName, org.apache.kafka.connect.data.Schema.Type type) protected voidassertRequiredFieldSchema(Document doc, String fieldName, org.apache.kafka.connect.data.Schema.Type type) protected PropertiesreadConfiguration(Path configFilePath) protected ArrayreadResults(File file) voidRun the connector with no known expected results so that it generates the results.voidRun the connector and verify thatRetriableExceptionis handled.voidRun the connector with connector configuration and expected results files, but find a mismatch in the results.voidRun the connector with connector configuration and expected results files, which are read in one step.voidRun the connector with connector configuration and expected results files, which are read in one step.voidRun the connector with connector configuration and expected results files, which are read in two steps.protected voidwriteConfigurationFile(Path configFilePath, Properties props) protected voidwriteConfigurationFileWithDefaultName(Path dir, Properties props) protected voidwriteEnvironmentFileWithDefaultName(Path dir, Properties props) Methods inherited from class io.debezium.embedded.ConnectorOutputTest
addValueComparatorsByFieldPath, addValueComparatorsBySchemaName, afterEachTestMethod, cleanOffsetStorage, globallyIgnorableFieldNames, replaceVariables, runConnector, runConnector, runConnector, runConnector, runConnector, runConnector, usingSpec, usingSpec, usingSpec, usingSpec, usingSpec
-
Field Details
-
TOPIC_NAME
- See Also:
-
-
Constructor Details
-
SimpleSourceConnectorOutputTest
public SimpleSourceConnectorOutputTest()
-
-
Method Details
-
shouldGenerateExpected
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 thatRetriableExceptionis handled. -
writeConfigurationFileWithDefaultName
- Throws:
IOException
-
writeEnvironmentFileWithDefaultName
- Throws:
IOException
-
writeConfigurationFile
- Throws:
IOException
-
readConfiguration
- Throws:
IOException
-
appendStop
- Throws:
IOException
-
readResults
- Throws:
IOException
-
appendCommand
- Throws:
IOException
-
assertExpectedRecords
protected void assertExpectedRecords(Path path, int batchCount, int recordsPerBatch) throws IOException - Throws:
IOException
-
assertFieldSchema
-
assertRequiredFieldSchema
-
assertOptionalFieldSchema
-