public class MySqlConnectorIT extends AbstractConnectorTest
| Modifier and Type | Class and Description |
|---|---|
protected static class |
MySqlConnectorIT.BinlogPosition |
AbstractConnectorTest.SourceRecordsTesting.Debug, Testing.Files, Testing.InterruptableFunction, Testing.Network, Testing.Print, Testing.Timer| Modifier and Type | Field and Description |
|---|---|
private Configuration |
config |
private UniqueDatabase |
DATABASE |
private static Path |
DB_HISTORY_PATH |
private static int |
INITIAL_EVENT_COUNT |
private static int |
ORDERS_TABLE_EVENT_COUNT |
private static int |
PRODUCTS_TABLE_EVENT_COUNT |
private UniqueDatabase |
RO_DATABASE |
engine, logger, logTestName, OFFSET_STORE_PATH, pollTimeoutInMs, skipTestRule| Constructor and Description |
|---|
MySqlConnectorIT() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterEach() |
void |
beforeEach() |
private void |
dropDatabases() |
private org.apache.kafka.connect.data.Struct |
getAfter(org.apache.kafka.connect.source.SourceRecord record) |
private Optional<org.apache.kafka.connect.header.Header> |
getHeaderField(org.apache.kafka.connect.source.SourceRecord record,
String fieldName) |
private Optional<org.apache.kafka.connect.header.Header> |
getPKUpdateNewKeyHeader(org.apache.kafka.connect.source.SourceRecord record) |
private Optional<org.apache.kafka.connect.header.Header> |
getPKUpdateOldKeyHeader(org.apache.kafka.connect.source.SourceRecord record) |
void |
parseDeleteQuery()
This test case validates that if you enable MySQL option binlog_rows_query_log_events, then
the original SQL statement for a DELETE over a single row is parsed into the resulting event.
|
void |
parseMultipleInsertStatements()
This test case validates that if you enable MySQL option binlog_rows_query_log_events, then
the issue multiple INSERTs, the appropriate SQL statements are parsed into the resulting events.
|
void |
parseMultipleRowInsertStatement()
This test case validates that if you enable MySQL option binlog_rows_query_log_events, then
the issue single multi-row INSERT, the appropriate SQL statements are parsed into the resulting events.
|
void |
parseMultiRowDeleteQuery()
This test case validates that if you enable MySQL option binlog_rows_query_log_events, then
issue a multi-row DELETE, the resulting events get the original SQL statement.
|
void |
parseMultiRowUpdateQuery()
This test case validates that if you enable MySQL option binlog_rows_query_log_events, then
the original SQL statement for an UPDATE over a single row is parsed into the resulting event.
|
void |
parseUpdateQuery()
This test case validates that if you enable MySQL option binlog_rows_query_log_events, then
the original SQL statement for an UPDATE over a single row is parsed into the resulting event.
|
private List<org.apache.kafka.connect.source.SourceRecord> |
recordsForTopicForRoProductsTable(AbstractConnectorTest.SourceRecords records) |
void |
shouldConsumeAllEventsFromDatabaseUsingSnapshot() |
private void |
shouldConsumeAllEventsFromDatabaseUsingSnapshotByField(Field dbIncludeListField,
int serverId) |
void |
shouldConsumeAllEventsFromDatabaseUsingSnapshotOld() |
void |
shouldConsumeEventsWithIncludedColumns() |
void |
shouldConsumeEventsWithMaskedAndBlacklistedColumns() |
void |
shouldConsumeEventsWithMaskedHashedColumns() |
void |
shouldConsumeEventsWithNoSnapshot() |
void |
shouldConsumeEventsWithTruncatedColumns() |
void |
shouldEmitHeadersOnPrimaryKeyUpdate() |
void |
shouldEmitNoEventsForSkippedCreateOperations() |
void |
shouldEmitNoEventsForSkippedUpdateAndDeleteOperations() |
void |
shouldEmitNoSavepoints() |
void |
shouldEmitNoTombstoneOnDelete() |
void |
shouldEmitTombstoneOnDeleteByDefault() |
void |
shouldFailToValidateAdaptivePrecisionMode()
Specifying the adaptive time.precision.mode is no longer valid and a configuration validation
problem should be reported when that configuration option is used.
|
void |
shouldFailToValidateInvalidConfiguration() |
void |
shouldHandleIncludeListTables() |
void |
shouldHandleWhitelistedTables() |
void |
shouldIgnoreAlterTableForNonCapturedTablesNotStoredInHistory() |
void |
shouldIgnoreAlterTableForNonCapturedTablesStoredInHistory() |
void |
shouldIgnoreCreateIndexForNonCapturedTablesNotStoredInHistory() |
void |
shouldNotParseQueryIfConnectorNotConfiguredTo()
This test case validates that if you enable MySQL option binlog_rows_query_log_events,
but configure the connector to NOT include the query, it will not be included in the event.
|
void |
shouldNotParseQueryIfServerOptionDisabled()
This test case validates that if you disable MySQL option binlog_rows_query_log_events, then
the original SQL statement for an INSERT statement is NOT parsed into the resulting event.
|
void |
shouldNotStartWithInvalidConfiguration()
Verifies that the connector doesn't run with an invalid configuration.
|
void |
shouldOutputRecordsInCloudEventsFormat() |
void |
shouldParseQueryIfAvailableAndConnectorOptionEnabled()
This test case validates that if you enable MySQL option binlog_rows_query_log_events, then
the original SQL statement for an INSERT statement is parsed into the resulting event.
|
void |
shouldProcessCreateUniqueIndex() |
void |
shouldReceiveSchemaForNonWhitelistedTablesAndDatabases() |
void |
shouldRewriteIdentityKey() |
void |
shouldRewriteIdentityKeyWithMsgKeyColumnsFieldRegexValidation() |
void |
shouldRewriteIdentityKeyWithWhitespace() |
void |
shouldSaveSetCharacterSetWhenStoringOnlyMonitoredTables() |
void |
shouldUseMultipleOverriddenSelectStatementsDuringSnapshotting() |
void |
shouldUseOverriddenSelectStatementDuringSnapshotting() |
void |
shouldValidateAcceptableConfiguration() |
void |
shouldValidateLockingModeNoneWithValidSnapshotModeConfiguration()
Validates that SNAPSHOT_LOCKING_MODE 'none' is valid with all snapshot modes
|
void |
shouldValidateValidConfigurationWithSSL() |
void |
testEmptySchemaLogWarningWithDatabaseWhitelist() |
void |
testEmptySchemaWarningWithTableWhitelist() |
void |
testNoEmptySchemaLogWarningWithDatabaseWhitelist() |
void |
testNoEmptySchemaWarningWithTableWhitelist() |
private void |
waitForStreamingRunning(String serverName) |
assertBeginTransaction, assertConfigurationErrors, assertConfigurationErrors, assertConfigurationErrors, assertConnectorIsRunning, assertConnectorNotRunning, assertDelete, assertEndTransaction, assertEngineIsRunning, assertHasNoSourceQuery, assertInsert, assertKey, assertNoConfigurationErrors, assertNoRecordsToConsume, assertOffset, assertOffset, assertOnlyTransactionRecordsToConsume, assertRecordTransactionMetadata, assertSchemaMatchesStruct, assertSchemaMatchesStruct, assertSourceQuery, assertTombstone, assertTombstone, assertUpdate, assertValueField, configValue, consumeAvailableRecords, consumeDmlRecordsByTopic, consumeDmlRecordsByTopic, consumeDmlRecordsByTopic, consumeRecord, consumeRecords, consumeRecords, consumeRecords, consumeRecordsByTopic, consumeRecordsByTopic, consumeRecordsByTopic, debug, getMaximumEnqueuedRecordCount, getSnapshotMetricsObjectName, getStreamingMetricsObjectName, getStreamingMetricsObjectName, getStreamingNamespace, initializeConnectorTestFramework, isStreamingRunning, isStreamingRunning, isTransactionRecord, loggingCompletion, print, readLastCommittedOffset, readLastCommittedOffsets, setConsumeTimeout, skipAvroValidation, start, start, start, start, start, stopConnector, stopConnector, validate, waitForAvailableRecords, waitForConnectorShutdown, waitForSnapshotToBeCompleted, waitForStreamingRunning, waitForStreamingRunning, waitTimeForRecordsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdebug, once, once, print, print, printError, printError, printError, resetBeforeEachTest, time, timeprivate static final Path DB_HISTORY_PATH
private final UniqueDatabase DATABASE
private final UniqueDatabase RO_DATABASE
private static final int PRODUCTS_TABLE_EVENT_COUNT
private static final int ORDERS_TABLE_EVENT_COUNT
private static final int INITIAL_EVENT_COUNT
private Configuration config
public void beforeEach()
public void afterEach()
public void shouldNotStartWithInvalidConfiguration()
public void shouldFailToValidateInvalidConfiguration()
public void shouldValidateValidConfigurationWithSSL()
public void shouldValidateAcceptableConfiguration()
@FixFor(value="DBZ-639") public void shouldValidateLockingModeNoneWithValidSnapshotModeConfiguration()
private Optional<org.apache.kafka.connect.header.Header> getPKUpdateNewKeyHeader(org.apache.kafka.connect.source.SourceRecord record)
private Optional<org.apache.kafka.connect.header.Header> getPKUpdateOldKeyHeader(org.apache.kafka.connect.source.SourceRecord record)
private Optional<org.apache.kafka.connect.header.Header> getHeaderField(org.apache.kafka.connect.source.SourceRecord record, String fieldName)
public void shouldConsumeAllEventsFromDatabaseUsingSnapshot()
throws SQLException,
InterruptedException
SQLExceptionInterruptedExceptionpublic void shouldConsumeAllEventsFromDatabaseUsingSnapshotOld()
throws SQLException,
InterruptedException
SQLExceptionInterruptedExceptionprivate void shouldConsumeAllEventsFromDatabaseUsingSnapshotByField(Field dbIncludeListField, int serverId) throws SQLException, InterruptedException
SQLExceptionInterruptedExceptionpublic void shouldUseOverriddenSelectStatementDuringSnapshotting()
throws SQLException,
InterruptedException
SQLExceptionInterruptedExceptionpublic void shouldUseMultipleOverriddenSelectStatementsDuringSnapshotting()
throws SQLException,
InterruptedException
SQLExceptionInterruptedException@FixFor(value="DBZ-977") public void shouldIgnoreAlterTableForNonCapturedTablesNotStoredInHistory() throws SQLException, InterruptedException
SQLExceptionInterruptedException@FixFor(value="DBZ-1201") public void shouldSaveSetCharacterSetWhenStoringOnlyMonitoredTables() throws SQLException, InterruptedException
SQLExceptionInterruptedException@FixFor(value="DBZ-1246") public void shouldProcessCreateUniqueIndex() throws SQLException, InterruptedException
SQLExceptionInterruptedException@FixFor(value="DBZ-977") public void shouldIgnoreAlterTableForNonCapturedTablesStoredInHistory() throws SQLException, InterruptedException
SQLExceptionInterruptedException@FixFor(value="DBZ-1264") public void shouldIgnoreCreateIndexForNonCapturedTablesNotStoredInHistory() throws SQLException, InterruptedException
SQLExceptionInterruptedException@FixFor(value="DBZ-683") public void shouldReceiveSchemaForNonWhitelistedTablesAndDatabases() throws SQLException, InterruptedException
SQLExceptionInterruptedException@FixFor(value="DBZ-1546") public void shouldHandleIncludeListTables() throws SQLException, InterruptedException
SQLExceptionInterruptedExceptionpublic void shouldHandleWhitelistedTables()
throws SQLException,
InterruptedException
SQLExceptionInterruptedExceptionprivate void dropDatabases()
throws SQLException
SQLExceptionprivate org.apache.kafka.connect.data.Struct getAfter(org.apache.kafka.connect.source.SourceRecord record)
public void shouldConsumeEventsWithNoSnapshot()
throws SQLException,
InterruptedException
SQLExceptionInterruptedException@FixFor(value="DBZ-1962") public void shouldConsumeEventsWithIncludedColumns() throws SQLException, InterruptedException
SQLExceptionInterruptedExceptionpublic void shouldConsumeEventsWithMaskedAndBlacklistedColumns()
throws SQLException,
InterruptedException
SQLExceptionInterruptedException@FixFor(value="DBZ-1692") public void shouldConsumeEventsWithMaskedHashedColumns() throws InterruptedException
InterruptedException@FixFor(value="DBZ-1972") public void shouldConsumeEventsWithTruncatedColumns() throws InterruptedException
InterruptedException@FixFor(value="DBZ-582") public void shouldEmitTombstoneOnDeleteByDefault() throws Exception
Exception@FixFor(value="DBZ-582") public void shouldEmitNoTombstoneOnDelete() throws Exception
Exception@FixFor(value="DBZ-794") public void shouldEmitNoSavepoints() throws Exception
Exception@FixFor(value="DBZ-706") public void shouldNotParseQueryIfServerOptionDisabled() throws Exception
Exception@FixFor(value="DBZ-706") public void shouldNotParseQueryIfConnectorNotConfiguredTo() throws Exception
Exception@FixFor(value="DBZ-706") public void shouldParseQueryIfAvailableAndConnectorOptionEnabled() throws Exception
Exception@FixFor(value="DBZ-706") public void parseMultipleInsertStatements() throws Exception
Exception@FixFor(value="DBZ-706") public void parseMultipleRowInsertStatement() throws Exception
Exception@FixFor(value="DBZ-706") public void parseDeleteQuery() throws Exception
Exception@FixFor(value="DBZ-706") public void parseMultiRowDeleteQuery() throws Exception
Exception@FixFor(value="DBZ-706") public void parseUpdateQuery() throws Exception
Exception@FixFor(value="DBZ-706") public void parseMultiRowUpdateQuery() throws Exception
Exception@FixFor(value="DBZ-1234") public void shouldFailToValidateAdaptivePrecisionMode() throws InterruptedException
InterruptedException@FixFor(value="DBZ-1242") public void testEmptySchemaLogWarningWithDatabaseWhitelist() throws Exception
Exception@FixFor(value="DBZ-1242") public void testNoEmptySchemaLogWarningWithDatabaseWhitelist() throws Exception
Exception@FixFor(value="DBZ-1242") public void testEmptySchemaWarningWithTableWhitelist() throws Exception
Exception@FixFor(value="DBZ-1242") public void testNoEmptySchemaWarningWithTableWhitelist() throws Exception
Exception@FixFor(value="DBZ-1015") public void shouldRewriteIdentityKey() throws InterruptedException, SQLException
InterruptedExceptionSQLException@FixFor(value="DBZ-2957") public void shouldRewriteIdentityKeyWithWhitespace() throws InterruptedException, SQLException
InterruptedExceptionSQLException@FixFor(value="DBZ-2957") public void shouldRewriteIdentityKeyWithMsgKeyColumnsFieldRegexValidation() throws InterruptedException, SQLException
InterruptedExceptionSQLException@FixFor(value="DBZ-1292") public void shouldOutputRecordsInCloudEventsFormat() throws Exception
Exceptionprivate void waitForStreamingRunning(String serverName) throws InterruptedException
InterruptedExceptionprivate List<org.apache.kafka.connect.source.SourceRecord> recordsForTopicForRoProductsTable(AbstractConnectorTest.SourceRecords records)
@FixFor(value="DBZ-1531") public void shouldEmitHeadersOnPrimaryKeyUpdate() throws Exception
Exception@FixFor(value="DBZ-1895") public void shouldEmitNoEventsForSkippedCreateOperations() throws Exception
ExceptionCopyright © 2021 JBoss by Red Hat. All rights reserved.