public class MongoDbConnectorIT extends AbstractConnectorTest
AbstractConnectorTest.SourceRecordsTesting.Debug, Testing.Files, Testing.InterruptableFunction, Testing.Network, Testing.Print, Testing.Timer| Modifier and Type | Field and Description |
|---|---|
private Configuration |
config |
private io.debezium.connector.mongodb.MongoDbTaskContext |
context |
engine, logger, logTestName, OFFSET_STORE_PATH, pollTimeoutInMs, skipTestRule| Constructor and Description |
|---|
MongoDbConnectorIT() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterEach() |
private static void |
assertSourceRecordKeyFieldIsEqualTo(org.apache.kafka.connect.source.SourceRecord record,
String fieldName,
String expected) |
void |
beforeEach() |
protected BiConsumer<String,Throwable> |
connectionErrorHandler(int numErrorsBeforeFailing) |
private void |
deleteDocument(String dbName,
String collectionName,
org.bson.types.ObjectId objectId) |
private String |
formatObjectId(org.bson.types.ObjectId objId) |
private void |
insertDocuments(String dbName,
String collectionName,
org.bson.Document... documents) |
protected List<org.bson.Document> |
loadTestDocuments(String pathOnClasspath) |
protected io.debezium.connector.mongodb.ConnectionContext.MongoPrimary |
primary() |
void |
shouldConsumeAllEventsFromDatabase() |
void |
shouldConsumeAllEventsFromDatabaseWithCustomAuthSource() |
void |
shouldConsumeAllEventsFromDatabaseWithSkippedOperations() |
void |
shouldConsumeEventsFromCollectionWithReplacedTopicName() |
void |
shouldConsumeTransaction() |
void |
shouldEmitHeartbeatMessages() |
void |
shouldFailToValidateInvalidConfiguration() |
void |
shouldFilterItemsInCollectionWhileTakingSnapshot() |
void |
shouldGenerateRecordForDeleteEventWithoutTombstone() |
void |
shouldGenerateRecordForInsertEvent() |
void |
shouldGenerateRecordForUpdateEvent() |
void |
shouldGenerateRecordForUpdateEventUsingLegacyV1SourceInfo() |
void |
shouldGenerateRecordsWithCorrectlySerializedId() |
void |
shouldGeneratorRecordForDeleteEvent() |
void |
shouldNotReplicateSnapshot() |
void |
shouldNotStartWithInvalidConfiguration()
Verifies that the connector doesn't run with an invalid configuration.
|
void |
shouldOutputRecordsInCloudEventsFormat() |
void |
shouldReplicateContent() |
void |
shouldResumeTransactionInMiddle() |
void |
shouldSelectivelySnapshot() |
void |
shouldSnapshotDocumentContainingFieldNamedOp() |
void |
shouldSupportDbRef() |
void |
shouldSupportDbRef2() |
void |
shouldUseSSL() |
void |
shouldValidateAcceptableConfiguration() |
protected void |
storeDocuments(com.mongodb.client.ClientSession session,
com.mongodb.client.MongoCollection<org.bson.Document> collection,
String pathOnClasspath) |
protected void |
storeDocuments(com.mongodb.client.MongoCollection<org.bson.Document> collection,
String pathOnClasspath) |
protected void |
storeDocuments(String dbName,
String collectionName,
String pathOnClasspath) |
protected void |
storeDocumentsInTx(String dbName,
String collectionName,
String pathOnClasspath) |
void |
testEmptySchemaWarningAfterApplyingCollectionFilters() |
private org.bson.types.ObjectId |
toObjectId(String oid) |
private void |
updateDocuments(String dbName,
String collectionName,
org.bson.Document filter,
org.bson.Document document) |
protected void |
verifyCreateOperation(org.apache.kafka.connect.source.SourceRecord record) |
protected void |
verifyDeleteOperation(org.apache.kafka.connect.source.SourceRecord record) |
protected void |
verifyFromInitialSync(org.apache.kafka.connect.source.SourceRecord record,
AtomicBoolean foundLast) |
protected void |
verifyFromTransaction(org.apache.kafka.connect.source.SourceRecord record,
long order) |
protected void |
verifyNotFromInitialSync(org.apache.kafka.connect.source.SourceRecord record) |
protected void |
verifyNotFromTransaction(org.apache.kafka.connect.source.SourceRecord record) |
protected void |
verifyOperation(org.apache.kafka.connect.source.SourceRecord record,
Envelope.Operation expected) |
protected void |
verifyReadOperation(org.apache.kafka.connect.source.SourceRecord record) |
protected void |
verifyUpdateOperation(org.apache.kafka.connect.source.SourceRecord record) |
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 Configuration config
private io.debezium.connector.mongodb.MongoDbTaskContext context
public void beforeEach()
public void afterEach()
public void shouldNotStartWithInvalidConfiguration()
public void shouldFailToValidateInvalidConfiguration()
public void shouldValidateAcceptableConfiguration()
public void shouldConsumeAllEventsFromDatabase()
throws InterruptedException,
IOException
InterruptedExceptionIOException@FixFor(value="DBZ-1831") public void shouldConsumeAllEventsFromDatabaseWithSkippedOperations() throws InterruptedException, IOException
InterruptedExceptionIOException@FixFor(value="DBZ-1168") public void shouldConsumeAllEventsFromDatabaseWithCustomAuthSource() throws InterruptedException, IOException
InterruptedExceptionIOException@FixFor(value="DBZ-1767") public void shouldSupportDbRef() throws InterruptedException, IOException
InterruptedExceptionIOException@FixFor(value="DBZ-865 and DBZ-1242") public void shouldConsumeEventsFromCollectionWithReplacedTopicName() throws InterruptedException, IOException
InterruptedExceptionIOException@FixFor(value="DBZ-1242") public void testEmptySchemaWarningAfterApplyingCollectionFilters() throws Exception
Exceptionprotected void verifyFromInitialSync(org.apache.kafka.connect.source.SourceRecord record,
AtomicBoolean foundLast)
@FixFor(value="DBZ-1215") public void shouldConsumeTransaction() throws InterruptedException, IOException
InterruptedExceptionIOException@FixFor(value="DBZ-1215") public void shouldResumeTransactionInMiddle() throws InterruptedException, IOException
InterruptedExceptionIOException@FixFor(value="DBZ-2116") public void shouldSnapshotDocumentContainingFieldNamedOp() throws Exception
Exception@FixFor(value="DBZ-2496") public void shouldFilterItemsInCollectionWhileTakingSnapshot() throws Exception
Exception@FixFor(value="DBZ-2456") public void shouldSelectivelySnapshot() throws InterruptedException
InterruptedExceptionprotected void verifyNotFromInitialSync(org.apache.kafka.connect.source.SourceRecord record)
protected void verifyFromTransaction(org.apache.kafka.connect.source.SourceRecord record,
long order)
protected void verifyNotFromTransaction(org.apache.kafka.connect.source.SourceRecord record)
protected void verifyCreateOperation(org.apache.kafka.connect.source.SourceRecord record)
protected void verifyReadOperation(org.apache.kafka.connect.source.SourceRecord record)
protected void verifyUpdateOperation(org.apache.kafka.connect.source.SourceRecord record)
protected void verifyDeleteOperation(org.apache.kafka.connect.source.SourceRecord record)
protected void verifyOperation(org.apache.kafka.connect.source.SourceRecord record,
Envelope.Operation expected)
protected io.debezium.connector.mongodb.ConnectionContext.MongoPrimary primary()
protected void storeDocuments(String dbName, String collectionName, String pathOnClasspath)
protected void storeDocuments(com.mongodb.client.MongoCollection<org.bson.Document> collection,
String pathOnClasspath)
protected void storeDocumentsInTx(String dbName, String collectionName, String pathOnClasspath)
protected void storeDocuments(com.mongodb.client.ClientSession session,
com.mongodb.client.MongoCollection<org.bson.Document> collection,
String pathOnClasspath)
protected BiConsumer<String,Throwable> connectionErrorHandler(int numErrorsBeforeFailing)
public void shouldUseSSL()
throws InterruptedException,
IOException
InterruptedExceptionIOException@FixFor(value="DBZ-1198") public void shouldEmitHeartbeatMessages() throws InterruptedException, IOException
InterruptedExceptionIOException@FixFor(value="DBZ-1292") public void shouldOutputRecordsInCloudEventsFormat() throws Exception
Exceptionpublic void shouldGenerateRecordForInsertEvent()
throws Exception
Exceptionpublic void shouldGenerateRecordForUpdateEvent()
throws Exception
Exceptionpublic void shouldGeneratorRecordForDeleteEvent()
throws Exception
Exception@FixFor(value="DBZ-582") public void shouldGenerateRecordForDeleteEventWithoutTombstone() throws Exception
Exceptionpublic void shouldGenerateRecordsWithCorrectlySerializedId()
throws Exception
Exceptionprivate static void assertSourceRecordKeyFieldIsEqualTo(org.apache.kafka.connect.source.SourceRecord record,
String fieldName,
String expected)
public void shouldNotReplicateSnapshot()
throws Exception
Exception@FixFor(value="DBZ-1880") public void shouldGenerateRecordForUpdateEventUsingLegacyV1SourceInfo() throws Exception
Exceptionprivate String formatObjectId(org.bson.types.ObjectId objId)
private void insertDocuments(String dbName, String collectionName, org.bson.Document... documents)
private void updateDocuments(String dbName, String collectionName, org.bson.Document filter, org.bson.Document document)
private void deleteDocument(String dbName, String collectionName, org.bson.types.ObjectId objectId)
private org.bson.types.ObjectId toObjectId(String oid)
Copyright © 2021 JBoss by Red Hat. All rights reserved.