Package io.debezium.connector.mongodb
Class MongoDbConnectorIT
java.lang.Object
io.debezium.embedded.AbstractConnectorTest
io.debezium.connector.mongodb.AbstractMongoConnectorIT
io.debezium.connector.mongodb.MongoDbConnectorIT
- All Implemented Interfaces:
Testing
- Author:
- Randall Hauch
-
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
Fields inherited from class io.debezium.connector.mongodb.AbstractMongoConnectorIT
config, context, logInterceptor, mongoFields inherited from class io.debezium.embedded.AbstractConnectorTest
consumedLines, engine, logger, logTestName, OFFSET_STORE_PATH, pollTimeoutInMs, skipTestRule -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidassertSourceRecordKeyFieldIsEqualTo(org.apache.kafka.connect.source.SourceRecord record, String fieldName, String expected) private voiddeleteDocument(String dbName, String collectionName, org.bson.types.ObjectId objectId) private StringformatObjectId(org.bson.types.ObjectId objId) protected List<org.bson.Document>loadTestDocuments(String pathOnClasspath) Load test documents from the classpath.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidVerifies that the connector doesn't run with an invalid configuration.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidshouldValidateFilterFieldConfiguration(Field field, String value, int errorCount) protected voidstoreDocuments(com.mongodb.client.ClientSession session, com.mongodb.client.MongoCollection<org.bson.Document> collection, String pathOnClasspath) protected voidstoreDocuments(com.mongodb.client.MongoCollection<org.bson.Document> collection, String pathOnClasspath) protected voidstoreDocuments(String dbName, String collectionName, String pathOnClasspath) protected voidstoreDocumentsInTx(String dbName, String collectionName, String pathOnClasspath) voidprivate org.bson.types.ObjectIdtoObjectId(String oid) protected voidverifyCreateOperation(org.apache.kafka.connect.source.SourceRecord record) protected voidverifyDeleteOperation(org.apache.kafka.connect.source.SourceRecord record) protected voidverifyFromInitialSync(org.apache.kafka.connect.source.SourceRecord record, AtomicBoolean foundLast) protected voidverifyNotFromInitialSync(org.apache.kafka.connect.source.SourceRecord record) protected voidverifyOperation(org.apache.kafka.connect.source.SourceRecord record, Envelope.Operation expected) protected voidverifyReadOperation(org.apache.kafka.connect.source.SourceRecord record) protected voidverifyUpdateOperation(org.apache.kafka.connect.source.SourceRecord record) Methods inherited from class io.debezium.connector.mongodb.AbstractMongoConnectorIT
afterAll, afterEach, beforeAll, beforeEach, connect, deleteDocuments, dropAndInsertDocuments, getSnapshotMetricsObjectName, getSnapshotMetricsObjectName, getStreamingMetricsObjectName, getStreamingMetricsObjectName, insertDocuments, insertDocumentsInTx, updateDocument, updateDocumentsInTx, waitForSnapshotToBeCompleted, waitForSnapshotToBeCompleted, waitForStreamingRunning, waitForStreamingRunningMethods 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, consumeAvailableRecordsByTopic, consumeDmlRecordsByTopic, consumeDmlRecordsByTopic, consumeDmlRecordsByTopic, consumeRecord, consumeRecords, consumeRecords, consumeRecords, consumeRecordsButSkipUntil, consumeRecordsByTopic, consumeRecordsByTopic, consumeRecordsByTopic, consumeRecordsByTopicUntil, consumeRecordsUntil, debug, getConsumer, getMaximumEnqueuedRecordCount, getSnapshotMetricsObjectName, getSnapshotMetricsObjectName, getStreamingMetricsObjectName, getStreamingMetricsObjectName, getStreamingMetricsObjectName, getStreamingNamespace, initializeConnectorTestFramework, isStreamingRunning, isStreamingRunning, isStreamingRunning, isStreamingRunning, isTransactionRecord, loggingCompletion, print, readLastCommittedOffset, readLastCommittedOffsets, setConsumeTimeout, skipAvroValidation, start, start, start, start, start, start, start, startAndConsumeTillEnd, startAndConsumeTillEnd, stopConnector, stopConnector, validate, waitForAvailableRecords, waitForConnectorShutdown, waitForNotInitialState, waitForSnapshotToBeCompleted, waitForSnapshotWithCustomMetricsToBeCompleted, waitForStreamingRunning, waitForStreamingRunning, waitForStreamingWithCustomMetricsToStart, waitTimeForRecords, waitTimeForRecordsAfterNulls
-
Constructor Details
-
MongoDbConnectorIT
public MongoDbConnectorIT()
-
-
Method Details
-
shouldNotStartWithInvalidConfiguration
public void shouldNotStartWithInvalidConfiguration()Verifies that the connector doesn't run with an invalid configuration. This does not actually connect to the Mongo server. -
shouldFailToValidateInvalidConfiguration
public void shouldFailToValidateInvalidConfiguration() -
shouldThrowExceptionWhenFieldExcludeListDatabasePartIsOnlyProvided
public void shouldThrowExceptionWhenFieldExcludeListDatabasePartIsOnlyProvided() -
shouldThrowExceptionWhenFieldExcludeListDatabaseAndCollectionPartIsOnlyProvided
public void shouldThrowExceptionWhenFieldExcludeListDatabaseAndCollectionPartIsOnlyProvided() -
shouldThrowExceptionWhenFieldExcludeListDatabaseAndCollectionPartsAreMissing
public void shouldThrowExceptionWhenFieldExcludeListDatabaseAndCollectionPartsAreMissing() -
shouldThrowExceptionWhenFieldExcludeListFieldPartIsMissing
public void shouldThrowExceptionWhenFieldExcludeListFieldPartIsMissing() -
shouldNotThrowExceptionWhenFieldExcludeListHasLeadingWhiteSpaces
public void shouldNotThrowExceptionWhenFieldExcludeListHasLeadingWhiteSpaces() -
shouldNotThrowExceptionWhenFieldExcludeListHasWhiteSpaces
public void shouldNotThrowExceptionWhenFieldExcludeListHasWhiteSpaces() -
shouldNotThrowExceptionWhenFieldExcludeListIsValid
public void shouldNotThrowExceptionWhenFieldExcludeListIsValid() -
shouldThrowExceptionWhenFieldRenamesDatabaseAndCollectionPartsAreMissing
public void shouldThrowExceptionWhenFieldRenamesDatabaseAndCollectionPartsAreMissing() -
shouldThrowExceptionWhenFieldRenamesReplacementPartIsMissing
public void shouldThrowExceptionWhenFieldRenamesReplacementPartIsMissing() -
shouldThrowExceptionWhenFieldRenamesReplacementPartSeparatorIsMissing
public void shouldThrowExceptionWhenFieldRenamesReplacementPartSeparatorIsMissing() -
shouldThrowExceptionWhenFieldRenamesRenameMappingKeyIsMissing
public void shouldThrowExceptionWhenFieldRenamesRenameMappingKeyIsMissing() -
shouldThrowExceptionWhenFieldRenamesRenameMappingValueIsMissing
public void shouldThrowExceptionWhenFieldRenamesRenameMappingValueIsMissing() -
shouldNotThrowExceptionWhenFieldRenamesHasLeadingWhiteSpaces
public void shouldNotThrowExceptionWhenFieldRenamesHasLeadingWhiteSpaces() -
shouldNotThrowExceptionWhenFieldRenamesHasWhiteSpaces
public void shouldNotThrowExceptionWhenFieldRenamesHasWhiteSpaces() -
shouldNotThrowExceptionWhenFieldRenamesIsValid
public void shouldNotThrowExceptionWhenFieldRenamesIsValid() -
shouldValidateFilterFieldConfiguration
-
shouldValidateAcceptableConfiguration
public void shouldValidateAcceptableConfiguration() -
shouldProvideWallTime
- Throws:
InterruptedException
-
shouldNotProvideWallTimeForOlderVersions
- Throws:
InterruptedException
-
shouldConsumePreImage
- Throws:
InterruptedException
-
shouldConsumeAllEventsFromDatabase
- Throws:
InterruptedExceptionIOException
-
shouldSkipOversizedEvents
- Throws:
InterruptedExceptionIOException
-
shouldConsumeAllEventsFromDatabaseWithSkippedOperations
@FixFor("DBZ-1831") public void shouldConsumeAllEventsFromDatabaseWithSkippedOperations() throws InterruptedException, IOException- Throws:
InterruptedExceptionIOException
-
shouldConsumeAllEventsFromDatabaseWithCustomAuthSource
@FixFor("DBZ-1168") public void shouldConsumeAllEventsFromDatabaseWithCustomAuthSource() throws InterruptedException, IOException- Throws:
InterruptedExceptionIOException
-
shouldConsumeEventsOnlyFromIncludedDatabases
@FixFor("DBZ-4575") public void shouldConsumeEventsOnlyFromIncludedDatabases() throws InterruptedException, IOException- Throws:
InterruptedExceptionIOException
-
shouldSupportDbRef
- Throws:
InterruptedExceptionIOException
-
shouldConsumeEventsFromCollectionWithReplacedTopicName
@FixFor("DBZ-865 and DBZ-1242") public void shouldConsumeEventsFromCollectionWithReplacedTopicName() throws InterruptedException, IOException- Throws:
InterruptedExceptionIOException
-
testEmptySchemaWarningAfterApplyingCollectionFilters
@FixFor("DBZ-1242") public void testEmptySchemaWarningAfterApplyingCollectionFilters() throws Exception- Throws:
Exception
-
verifyFromInitialSync
protected void verifyFromInitialSync(org.apache.kafka.connect.source.SourceRecord record, AtomicBoolean foundLast) -
shouldConsumeTransaction
- Throws:
InterruptedExceptionIOException
-
shouldResumeTransactionInMiddle
@FixFor("DBZ-1215") public void shouldResumeTransactionInMiddle() throws InterruptedException, IOException- Throws:
InterruptedExceptionIOException
-
shouldSnapshotDocumentContainingFieldNamedOp
- Throws:
Exception
-
shouldFilterItemsInCollectionWhileTakingSnapshot
- Throws:
Exception
-
shouldSelectivelySnapshot
- Throws:
InterruptedException
-
verifyNotFromInitialSync
protected void verifyNotFromInitialSync(org.apache.kafka.connect.source.SourceRecord record) -
verifyCreateOperation
protected void verifyCreateOperation(org.apache.kafka.connect.source.SourceRecord record) -
verifyReadOperation
protected void verifyReadOperation(org.apache.kafka.connect.source.SourceRecord record) -
verifyUpdateOperation
protected void verifyUpdateOperation(org.apache.kafka.connect.source.SourceRecord record) -
verifyDeleteOperation
protected void verifyDeleteOperation(org.apache.kafka.connect.source.SourceRecord record) -
verifyOperation
protected void verifyOperation(org.apache.kafka.connect.source.SourceRecord record, Envelope.Operation expected) -
storeDocuments
- Overrides:
storeDocumentsin classAbstractMongoConnectorIT
-
storeDocuments
protected void storeDocuments(com.mongodb.client.MongoCollection<org.bson.Document> collection, String pathOnClasspath) - Overrides:
storeDocumentsin classAbstractMongoConnectorIT
-
storeDocumentsInTx
-
storeDocuments
protected void storeDocuments(com.mongodb.client.ClientSession session, com.mongodb.client.MongoCollection<org.bson.Document> collection, String pathOnClasspath) -
loadTestDocuments
Description copied from class:AbstractMongoConnectorITLoad test documents from the classpath.- Overrides:
loadTestDocumentsin classAbstractMongoConnectorIT- Parameters:
pathOnClasspath- the path on the classpath to the file containing the documents to load- Returns:
- list of loaded documents; never null but may contain no entries.
-
shouldEmitHeartbeatMessages
@FixFor("DBZ-1198") public void shouldEmitHeartbeatMessages() throws InterruptedException, IOException- Throws:
InterruptedExceptionIOException
-
shouldOutputRecordsInCloudEventsFormat
- Throws:
Exception
-
shouldGenerateRecordForInsertEvent
- Throws:
Exception
-
shouldGenerateRecordForUpdateEvent
- Throws:
Exception
-
shouldGeneratorRecordForDeleteEvent
- Throws:
Exception
-
shouldGenerateRecordForDeleteEventWithoutTombstone
@FixFor("DBZ-582") public void shouldGenerateRecordForDeleteEventWithoutTombstone() throws Exception- Throws:
Exception
-
shouldGenerateRecordsWithCorrectlySerializedId
- Throws:
Exception
-
shouldSkipNonPipelineRecords
- Throws:
Exception
-
assertSourceRecordKeyFieldIsEqualTo
-
shouldSupportDbRef2
- Throws:
Exception
-
shouldReplicateContent
- Throws:
Exception
-
shouldNotReplicateSnapshot
- Throws:
Exception
-
shouldGenerateRecordForUpdateEventUsingLegacyV1SourceInfo
@FixFor("DBZ-1880") public void shouldGenerateRecordForUpdateEventUsingLegacyV1SourceInfo() throws Exception- Throws:
Exception
-
formatObjectId
-
deleteDocument
-
toObjectId
-