Package io.debezium.connector.mongodb
Class AbstractShardedMongoConnectorIT
java.lang.Object
io.debezium.embedded.AbstractConnectorTest
io.debezium.connector.mongodb.AbstractShardedMongoConnectorIT
- All Implemented Interfaces:
Testing
- Direct Known Subclasses:
OffsetConsolidationShardedIT,ShardedIncrementalSnapshotIT,ShardedMongoDbConnectorIT
-
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 TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static MongoDbShardedClusterFields inherited from class io.debezium.embedded.AbstractConnectorTest
consumedLines, engine, isEngineRunning, logger, logTestName, OFFSET_STORE_PATH, pollTimeoutInMs, skipTestRule -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidafterAll()voidstatic voidvoidprivate static booleancollectionExists(com.mongodb.client.MongoDatabase database, String collectionName) protected static com.mongodb.client.MongoClientconnect()protected static com.mongodb.client.MongoClientconnect(MongoDbDeployment mongo) protected voidinsertDocuments(String dbName, String collectionName, org.bson.Document... documents) Inserts all documents in the specified collection.protected voidinsertDocumentsInTx(String dbName, String collectionName, org.bson.Document... documents) Inserts all documents in the specified collection within a transaction.protected Stringprotected Stringprotected voidverifyFromInitialSnapshot(org.apache.kafka.connect.source.SourceRecord record, AtomicBoolean foundLast) protected voidverifyNotFromInitialSnapshot(org.apache.kafka.connect.source.SourceRecord record) protected voidverifyOperation(org.apache.kafka.connect.source.SourceRecord record, Envelope.Operation expected) 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, consumeAvailableRecordsByTopic, consumeDmlRecordsByTopic, consumeDmlRecordsByTopic, consumeDmlRecordsByTopic, consumeRecord, consumeRecords, consumeRecords, consumeRecords, consumeRecordsButSkipUntil, consumeRecordsByTopic, consumeRecordsByTopic, consumeRecordsByTopic, consumeRecordsByTopicUntil, consumeRecordsUntil, createEngine, createEngineBuilder, debug, getConsumer, getMaximumEnqueuedRecordCount, getSnapshotMetricsObjectName, getSnapshotMetricsObjectName, getSnapshotMetricsObjectName, getStreamingMetricsObjectName, 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, storeOffsets, validate, waitForAvailableRecords, waitForConnectorShutdown, waitForEngineShutdown, waitForSnapshotToBeCompleted, waitForSnapshotToBeCompleted, waitForSnapshotWithCustomMetricsToBeCompleted, waitForStreamingRunning, waitForStreamingRunning, waitForStreamingRunning, waitForStreamingWithCustomMetricsToStart, waitTimeForEngine, waitTimeForRecords, waitTimeForRecordsAfterNulls
-
Field Details
-
DEFAULT_DATABASE
- See Also:
-
DEFAULT_COLLECTION
- See Also:
-
DEFAULT_SHARDING_KEY
- See Also:
-
mongo
-
-
Constructor Details
-
AbstractShardedMongoConnectorIT
public AbstractShardedMongoConnectorIT()
-
-
Method Details
-
connect
protected static com.mongodb.client.MongoClient connect() -
connect
-
beforeAll
public static void beforeAll() -
afterAll
public static void afterAll() -
beforeEach
public void beforeEach() -
afterEach
public void afterEach() -
shardedDatabase
-
shardedCollections
-
shardedCollection
-
insertDocuments
protected void insertDocuments(String dbName, String collectionName, org.bson.Document... documents) Inserts all documents in the specified collection.- Parameters:
dbName- the database namecollectionName- the collection namedocuments- the documents to be inserted, can be empty
-
insertDocumentsInTx
protected void insertDocumentsInTx(String dbName, String collectionName, org.bson.Document... documents) Inserts all documents in the specified collection within a transaction.- Parameters:
dbName- the database namecollectionName- the collection namedocuments- the documents to be inserted, can be empty
-
collectionExists
private static boolean collectionExists(com.mongodb.client.MongoDatabase database, String collectionName) -
verifyNotFromInitialSnapshot
protected void verifyNotFromInitialSnapshot(org.apache.kafka.connect.source.SourceRecord record) -
verifyFromInitialSnapshot
protected void verifyFromInitialSnapshot(org.apache.kafka.connect.source.SourceRecord record, AtomicBoolean foundLast) -
verifyOperation
protected void verifyOperation(org.apache.kafka.connect.source.SourceRecord record, Envelope.Operation expected)
-