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
public class FieldRenamesIT extends AbstractMongoConnectorIT
- Author:
- Chris Cranford
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.debezium.embedded.AbstractConnectorTest
AbstractConnectorTest.SourceRecords
-
Nested classes/interfaces inherited from interface io.debezium.util.Testing
Testing.Debug, Testing.Files, Testing.InterruptableFunction, Testing.Network, Testing.Print, Testing.Timer
-
-
Field Summary
Fields Modifier and Type Field Description private static StringCOLLECTION_NAMEprivate static StringDATABASE_NAMEprivate static StringIDprivate static StringPATCHprivate static StringSERVER_NAME-
Fields inherited from class io.debezium.connector.mongodb.AbstractMongoConnectorIT
config, context, logInterceptor
-
Fields inherited from class io.debezium.embedded.AbstractConnectorTest
engine, logger, logTestName, OFFSET_STORE_PATH, pollTimeoutInMs, skipTestRule
-
-
Constructor Summary
Constructors Constructor Description FieldRenamesIT()
-
Method Summary
-
Methods inherited from class io.debezium.connector.mongodb.AbstractMongoConnectorIT
afterEach, beforEach, connectionErrorHandler, deleteDocuments, dropAndInsertDocuments, insertDocuments, insertDocumentsInTx, loadTestDocuments, primary, storeDocuments, storeDocuments, updateDocument
-
Methods 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, debug, getMaximumEnqueuedRecordCount, getSnapshotMetricsObjectName, getStreamingMetricsObjectName, getStreamingMetricsObjectName, getStreamingNamespace, initializeConnectorTestFramework, isStreamingRunning, isStreamingRunning, isTransactionRecord, loggingCompletion, print, readLastCommittedOffset, readLastCommittedOffsets, setConsumeTimeout, skipAvroValidation, start, start, start, start, start, startAndConsumeTillEnd, stopConnector, stopConnector, validate, waitForAvailableRecords, waitForConnectorShutdown, waitForSnapshotToBeCompleted, waitForStreamingRunning, waitForStreamingRunning, waitTimeForRecords, waitTimeForRecordsAfterNulls
-
-
-
-
Field Detail
-
DATABASE_NAME
private static final String DATABASE_NAME
- See Also:
- Constant Field Values
-
COLLECTION_NAME
private static final String COLLECTION_NAME
- See Also:
- Constant Field Values
-
SERVER_NAME
private static final String SERVER_NAME
- See Also:
- Constant Field Values
-
PATCH
private static final String PATCH
- See Also:
- Constant Field Values
-
ID
private static final String ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
shouldNotRenameMissingFieldsForReadEvent
public void shouldNotRenameMissingFieldsForReadEvent() throws Exception- Throws:
Exception
-
shouldNotRenameNestedMissingFieldsForReadEvent
public void shouldNotRenameNestedMissingFieldsForReadEvent() throws Exception- Throws:
Exception
-
shouldNotRenameMissingFieldsForInsertEvent
public void shouldNotRenameMissingFieldsForInsertEvent() throws Exception- Throws:
Exception
-
shouldNotRenameNestedMissingFieldsForInsertEvent
public void shouldNotRenameNestedMissingFieldsForInsertEvent() throws Exception- Throws:
Exception
-
shouldNotRenameNestedMissingFieldsForUpdateEventWithEmbeddedDocument
public void shouldNotRenameNestedMissingFieldsForUpdateEventWithEmbeddedDocument() throws Exception- Throws:
Exception
-
shouldNotRenameFieldsForEventOfOtherCollection
public void shouldNotRenameFieldsForEventOfOtherCollection() throws Exception- Throws:
Exception
-
shouldRenameFieldsForReadEvent
public void shouldRenameFieldsForReadEvent() throws Exception- Throws:
Exception
-
shouldRenameNestedFieldsForReadEvent
public void shouldRenameNestedFieldsForReadEvent() throws Exception- Throws:
Exception
-
shouldNotRenameNestedFieldsToExistingNamesForReadEvent
public void shouldNotRenameNestedFieldsToExistingNamesForReadEvent() throws Exception- Throws:
Exception
-
shouldRenameFieldsForInsertEvent
public void shouldRenameFieldsForInsertEvent() throws Exception- Throws:
Exception
-
shouldRenameNestedFieldsForInsertEvent
public void shouldRenameNestedFieldsForInsertEvent() throws Exception- Throws:
Exception
-
shouldNotRenameNestedFieldsToExistingNamesForInsertEvent
public void shouldNotRenameNestedFieldsToExistingNamesForInsertEvent() throws Exception- Throws:
Exception
-
shouldRenameFieldsForUpdateEvent
public void shouldRenameFieldsForUpdateEvent() throws Exception- Throws:
Exception
-
shouldNotRenameMissingFieldsForUpdateEvent
public void shouldNotRenameMissingFieldsForUpdateEvent() throws Exception- Throws:
Exception
-
shouldRenameNestedFieldsForUpdateEventWithEmbeddedDocument
public void shouldRenameNestedFieldsForUpdateEventWithEmbeddedDocument() throws Exception- Throws:
Exception
-
shouldNotRenameNestedFieldsToExistingNamesForUpdateEventWithEmbeddedDocument
public void shouldNotRenameNestedFieldsToExistingNamesForUpdateEventWithEmbeddedDocument() throws Exception- Throws:
Exception
-
shouldRenameNestedFieldsForUpdateEventWithArrayOfEmbeddedDocuments
public void shouldRenameNestedFieldsForUpdateEventWithArrayOfEmbeddedDocuments() throws Exception- Throws:
Exception
-
shouldNotRenameNestedFieldsForUpdateEventWithArrayOfArrays
public void shouldNotRenameNestedFieldsForUpdateEventWithArrayOfArrays() throws Exception- Throws:
Exception
-
shouldRenameFieldsForSetTopLevelFieldUpdateEvent
public void shouldRenameFieldsForSetTopLevelFieldUpdateEvent() throws Exception- Throws:
Exception
-
shouldNotRenameFieldsToExistingNamesForSetTopLevelFieldUpdateEvent
public void shouldNotRenameFieldsToExistingNamesForSetTopLevelFieldUpdateEvent() throws Exception- Throws:
Exception
-
shouldRenameFieldsForUnsetTopLevelFieldUpdateEvent
public void shouldRenameFieldsForUnsetTopLevelFieldUpdateEvent() throws Exception- Throws:
Exception
-
shouldNotRenameFieldsToExistingNamesForUnsetTopLevelFieldUpdateEvent
public void shouldNotRenameFieldsToExistingNamesForUnsetTopLevelFieldUpdateEvent() throws Exception- 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
public void shouldRenameFieldsForDeleteEvent() throws Exception- Throws:
Exception
-
shouldRenameFieldsForDeleteTombstoneEvent
public void shouldRenameFieldsForDeleteTombstoneEvent() throws Exception- Throws:
Exception
-
getFilterFromId
private static org.bson.Document getFilterFromId(org.bson.types.ObjectId id)
-
getDocumentFromPatch
private static org.bson.Document getDocumentFromPatch(org.apache.kafka.connect.data.Struct value)
-
getConfiguration
private static Configuration getConfiguration(String fieldRenames)
-
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
private void assertDocumentContainsFieldError(String fieldName)
-
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
-
-