Package io.debezium.connector.mongodb
Class FieldRenamesIT
java.lang.Object
io.debezium.embedded.AbstractConnectorTest
io.debezium.connector.mongodb.AbstractMongoConnectorIT
io.debezium.connector.mongodb.FieldRenamesIT
- All Implemented Interfaces:
Testing
- Author:
- Chris Cranford
-
Nested Class Summary
Nested classes/interfaces inherited from class io.debezium.embedded.AbstractConnectorTest
AbstractConnectorTest.SourceRecordsNested classes/interfaces inherited from interface io.debezium.util.Testing
Testing.Debug, Testing.Files, Testing.InterruptableFunction, Testing.Network, Testing.Print, Testing.Timer -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final StringFields inherited from class io.debezium.connector.mongodb.AbstractMongoConnectorIT
config, context, logInterceptorFields inherited from class io.debezium.embedded.AbstractConnectorTest
engine, logger, logTestName, OFFSET_STORE_PATH, pollTimeoutInMs, skipTestRule -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidassertDocumentContainsFieldError(String fieldName) private voidassertShouldNotRenameDuringInsert(String renamesList, org.bson.Document document, String fieldName) private voidassertShouldNotRenameDuringRead(String renamesList, org.bson.Document snapshot, String fieldName) private voidassertShouldNotRenameDuringUpdate(String renamesList, org.bson.Document snapshot, org.bson.Document update, boolean unset, String fieldName) private voidassertUpdateRecord(org.bson.types.ObjectId objectId, org.apache.kafka.connect.source.SourceRecord record, FieldBlacklistIT.ExpectedUpdate expected) private static ConfigurationgetConfiguration(String fieldRenames) private static ConfigurationgetConfiguration(String fieldRenames, String database, String collection) private static org.bson.DocumentgetDocumentFromUpdateRecord(org.apache.kafka.connect.data.Struct value) private static org.bson.DocumentgetFilterFromId(org.bson.types.ObjectId id) private org.apache.kafka.connect.source.SourceRecordgetInsertRecord(String database, String collection, String fieldRenames, org.bson.Document document) private org.apache.kafka.connect.source.SourceRecordgetInsertRecord(String fieldRenames, org.bson.Document document) private org.apache.kafka.connect.source.SourceRecordgetReadRecord(String database, String collection, String fieldRenames, org.bson.Document document) private org.apache.kafka.connect.source.SourceRecordgetReadRecord(String fieldRenames, org.bson.Document document) private org.apache.kafka.connect.source.SourceRecordgetUpdateRecord(String database, String collection, String fieldRenames, org.bson.Document snapshot, org.bson.Document document) private org.apache.kafka.connect.source.SourceRecordgetUpdateRecord(String fieldRenames, org.bson.Document snapshot, org.bson.Document document) voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidshouldNotRenameNestedFieldsToExistingNamesForSetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments()voidshouldNotRenameNestedFieldsToExistingNamesForUnsetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments()voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidMethods inherited from class io.debezium.connector.mongodb.AbstractMongoConnectorIT
afterEach, beforEach, connectionErrorHandler, deleteDocuments, dropAndInsertDocuments, insertDocuments, insertDocumentsInTx, loadTestDocuments, primary, storeDocuments, storeDocuments, updateDocument, updateDocumentsInTxMethods inherited from class io.debezium.embedded.AbstractConnectorTest
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, consumeRecordsByTopicUntil, consumeRecordsUntil, debug, getMaximumEnqueuedRecordCount, getSnapshotMetricsObjectName, getStreamingMetricsObjectName, getStreamingMetricsObjectName, getStreamingNamespace, initializeConnectorTestFramework, isStreamingRunning, isStreamingRunning, isTransactionRecord, loggingCompletion, print, readLastCommittedOffset, readLastCommittedOffsets, setConsumeTimeout, skipAvroValidation, start, start, start, start, start, startAndConsumeTillEnd, startAndConsumeTillEnd, stopConnector, stopConnector, validate, waitForAvailableRecords, waitForConnectorShutdown, waitForSnapshotToBeCompleted, waitForStreamingRunning, waitForStreamingRunning, waitTimeForRecords, waitTimeForRecordsAfterNulls
-
Field Details
-
DATABASE_NAME
- See Also:
-
COLLECTION_NAME
- See Also:
-
SERVER_NAME
- See Also:
-
PATCH
- See Also:
-
ID
- See Also:
-
-
Constructor Details
-
FieldRenamesIT
public FieldRenamesIT()
-
-
Method Details
-
shouldNotRenameMissingFieldsForReadEvent
- Throws:
Exception
-
shouldNotRenameNestedMissingFieldsForReadEvent
- Throws:
Exception
-
shouldNotRenameMissingFieldsForInsertEvent
- Throws:
Exception
-
shouldNotRenameNestedMissingFieldsForInsertEvent
- Throws:
Exception
-
shouldNotRenameNestedMissingFieldsForUpdateEventWithEmbeddedDocument
- Throws:
Exception
-
shouldNotRenameFieldsForEventOfOtherCollection
- Throws:
Exception
-
shouldRenameFieldsForReadEvent
- Throws:
Exception
-
shouldRenameNestedFieldsForReadEvent
- Throws:
Exception
-
shouldNotRenameNestedFieldsToExistingNamesForReadEvent
- Throws:
Exception
-
shouldRenameFieldsForInsertEvent
- Throws:
Exception
-
shouldRenameNestedFieldsForInsertEvent
- Throws:
Exception
-
shouldNotRenameNestedFieldsToExistingNamesForInsertEvent
- Throws:
Exception
-
shouldRenameFieldsForUpdateEvent
- Throws:
Exception
-
shouldNotRenameMissingFieldsForUpdateEvent
- Throws:
Exception
-
shouldRenameNestedFieldsForUpdateEventWithEmbeddedDocument
- Throws:
Exception
-
shouldNotRenameNestedFieldsToExistingNamesForUpdateEventWithEmbeddedDocument
public void shouldNotRenameNestedFieldsToExistingNamesForUpdateEventWithEmbeddedDocument() throws Exception- Throws:
Exception
-
shouldRenameNestedFieldsForUpdateEventWithArrayOfEmbeddedDocuments
- Throws:
Exception
-
shouldNotRenameNestedFieldsForUpdateEventWithArrayOfArrays
- Throws:
Exception
-
shouldRenameFieldsForSetTopLevelFieldUpdateEvent
- Throws:
Exception
-
shouldNotRenameFieldsToExistingNamesForSetTopLevelFieldUpdateEvent
- Throws:
Exception
-
shouldRenameFieldsForUnsetTopLevelFieldUpdateEvent
- Throws:
Exception
-
shouldNotRenameFieldsToExistingNamesForUnsetTopLevelFieldUpdateEvent
- Throws:
Exception
-
shouldRenameNestedFieldsForSetTopLevelFieldUpdateEventWithEmbeddedDocument
public void shouldRenameNestedFieldsForSetTopLevelFieldUpdateEventWithEmbeddedDocument() throws Exception- Throws:
Exception
-
shouldRenameNestedFieldsForSetTopLevelFieldUpdateEventWithArrayOfEmbeddedDocuments
public void shouldRenameNestedFieldsForSetTopLevelFieldUpdateEventWithArrayOfEmbeddedDocuments() throws Exception- Throws:
Exception
-
shouldNotRenameNestedFieldsForSetTopLevelFieldUpdateEventWithArrayOfArrays
public void shouldNotRenameNestedFieldsForSetTopLevelFieldUpdateEventWithArrayOfArrays() throws Exception- Throws:
Exception
-
shouldRenameNestedFieldsForSetNestedFieldUpdateEventWithEmbeddedDocument
public void shouldRenameNestedFieldsForSetNestedFieldUpdateEventWithEmbeddedDocument() throws Exception- Throws:
Exception
-
shouldRenameNestedFieldsForSetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments
public void shouldRenameNestedFieldsForSetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments() throws Exception- Throws:
Exception
-
shouldNotRenameNestedFieldsToExistingNamesForSetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments
public void shouldNotRenameNestedFieldsToExistingNamesForSetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments() throws Exception- Throws:
Exception
-
shouldNotRenameNestedFieldsForSetNestedFieldUpdateEventWithArrayOfArrays
public void shouldNotRenameNestedFieldsForSetNestedFieldUpdateEventWithArrayOfArrays() throws Exception- Throws:
Exception
-
shouldRenameNestedFieldsForSetNestedFieldUpdateEventWithSeveralArrays
public void shouldRenameNestedFieldsForSetNestedFieldUpdateEventWithSeveralArrays() throws Exception- Throws:
Exception
-
shouldRenameFieldsForSetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments
public void shouldRenameFieldsForSetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments() throws Exception- Throws:
Exception
-
shouldRenameFieldsForSetToArrayFieldUpdateEventWithArrayOfEmbeddedDocuments
public void shouldRenameFieldsForSetToArrayFieldUpdateEventWithArrayOfEmbeddedDocuments() throws Exception- Throws:
Exception
-
shouldRenameNestedFieldsForUnsetNestedFieldUpdateEventWithEmbeddedDocument
public void shouldRenameNestedFieldsForUnsetNestedFieldUpdateEventWithEmbeddedDocument() throws Exception- Throws:
Exception
-
shouldRenameNestedFieldsForUnsetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments
public void shouldRenameNestedFieldsForUnsetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments() throws Exception- Throws:
Exception
-
shouldNotRenameNestedFieldsToExistingNamesForUnsetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments
public void shouldNotRenameNestedFieldsToExistingNamesForUnsetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments() throws Exception- Throws:
Exception
-
shouldNotRenameNestedFieldsForUnsetNestedFieldUpdateEventWithArrayOfArrays
public void shouldNotRenameNestedFieldsForUnsetNestedFieldUpdateEventWithArrayOfArrays() throws Exception- Throws:
Exception
-
shouldRenameNestedFieldsForUnsetNestedFieldUpdateEventWithSeveralArrays
public void shouldRenameNestedFieldsForUnsetNestedFieldUpdateEventWithSeveralArrays() throws Exception- Throws:
Exception
-
shouldRenameFieldsForUnsetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments
public void shouldRenameFieldsForUnsetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments() throws Exception- Throws:
Exception
-
shouldRenameFieldsForDeleteEvent
- Throws:
Exception
-
shouldRenameFieldsForDeleteTombstoneEvent
- Throws:
Exception
-
getFilterFromId
private static org.bson.Document getFilterFromId(org.bson.types.ObjectId id) -
getDocumentFromUpdateRecord
private static org.bson.Document getDocumentFromUpdateRecord(org.apache.kafka.connect.data.Struct value) -
getConfiguration
-
getConfiguration
private static Configuration getConfiguration(String fieldRenames, String database, String collection) -
getReadRecord
private org.apache.kafka.connect.source.SourceRecord getReadRecord(String fieldRenames, org.bson.Document document) throws Exception - Throws:
Exception
-
getReadRecord
private org.apache.kafka.connect.source.SourceRecord getReadRecord(String database, String collection, String fieldRenames, org.bson.Document document) throws Exception - Throws:
Exception
-
getInsertRecord
private org.apache.kafka.connect.source.SourceRecord getInsertRecord(String fieldRenames, org.bson.Document document) throws Exception - Throws:
Exception
-
getInsertRecord
private org.apache.kafka.connect.source.SourceRecord getInsertRecord(String database, String collection, String fieldRenames, org.bson.Document document) throws Exception - Throws:
Exception
-
getUpdateRecord
private org.apache.kafka.connect.source.SourceRecord getUpdateRecord(String fieldRenames, org.bson.Document snapshot, org.bson.Document document) throws Exception - Throws:
Exception
-
getUpdateRecord
private org.apache.kafka.connect.source.SourceRecord getUpdateRecord(String database, String collection, String fieldRenames, org.bson.Document snapshot, org.bson.Document document) throws Exception - Throws:
Exception
-
assertDocumentContainsFieldError
-
assertShouldNotRenameDuringRead
private void assertShouldNotRenameDuringRead(String renamesList, org.bson.Document snapshot, String fieldName) throws Exception - Throws:
Exception
-
assertShouldNotRenameDuringInsert
private void assertShouldNotRenameDuringInsert(String renamesList, org.bson.Document document, String fieldName) throws Exception - Throws:
Exception
-
assertShouldNotRenameDuringUpdate
private void assertShouldNotRenameDuringUpdate(String renamesList, org.bson.Document snapshot, org.bson.Document update, boolean unset, String fieldName) throws Exception - Throws:
Exception
-
assertUpdateRecord
private void assertUpdateRecord(org.bson.types.ObjectId objectId, org.apache.kafka.connect.source.SourceRecord record, FieldBlacklistIT.ExpectedUpdate expected) throws InterruptedException - Throws:
InterruptedException
-