public abstract class AbstractMongoConnectorIT extends AbstractConnectorTest
AbstractConnectorTest.SourceRecordsTesting.Debug, Testing.Files, Testing.InterruptableFunction, Testing.Network, Testing.Print, Testing.Timer| Modifier and Type | Field and Description |
|---|---|
protected Configuration |
config |
protected io.debezium.connector.mongodb.MongoDbTaskContext |
context |
protected LogInterceptor |
logInterceptor |
engine, logger, logTestName, OFFSET_STORE_PATH, pollTimeoutInMs, skipTestRule| Constructor and Description |
|---|
AbstractMongoConnectorIT() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterEach() |
void |
beforEach() |
private static boolean |
collectionExists(com.mongodb.client.MongoDatabase database,
String collectionName) |
protected BiConsumer<String,Throwable> |
connectionErrorHandler(int numErrorsBeforeFailing) |
protected void |
deleteDocuments(String dbName,
String collectionName,
org.bson.Document filter)
Deletes a document in a collection based on a specified filter.
|
protected void |
dropAndInsertDocuments(String dbName,
String collectionName,
org.bson.Document... documents)
Drops the specified collection if it exists and inserts all documents into the empty collection.
|
protected void |
insertDocuments(String dbName,
String collectionName,
org.bson.Document... documents)
Inserts all documents in the specified collection.
|
protected void |
insertDocumentsInTx(String dbName,
String collectionName,
org.bson.Document... documents)
Inserts all documents in the specified collection within a transaction.
|
protected List<org.bson.Document> |
loadTestDocuments(String pathOnClasspath)
Load test documents from the classpath.
|
protected io.debezium.connector.mongodb.ConnectionContext.MongoPrimary |
primary() |
protected void |
storeDocuments(com.mongodb.client.MongoCollection<org.bson.Document> collection,
String pathOnClasspath) |
protected void |
storeDocuments(String dbName,
String collectionName,
String pathOnClasspath) |
protected void |
updateDocument(String dbName,
String collectionName,
org.bson.Document filter,
org.bson.Document document)
Updates a document in a collection based on a specified filter.
|
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, initializeConnectorTestFramework, isStreamingRunning, isStreamingRunning, isTransactionRecord, loggingCompletion, print, readLastCommittedOffset, readLastCommittedOffsets, setConsumeTimeout, start, start, start, start, start, stopConnector, stopConnector, validate, waitForAvailableRecords, waitForSnapshotToBeCompleted, waitForStreamingRunning, waitForStreamingRunning, waitTimeForRecordsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdebug, once, once, print, print, printError, printError, printError, resetBeforeEachTest, time, timeprotected Configuration config
protected io.debezium.connector.mongodb.MongoDbTaskContext context
protected LogInterceptor logInterceptor
public void beforEach()
public void afterEach()
protected List<org.bson.Document> loadTestDocuments(String pathOnClasspath)
pathOnClasspath - the path on the classpath to the file containing the documents to loadprotected void dropAndInsertDocuments(String dbName, String collectionName, org.bson.Document... documents)
dbName - the database namecollectionName - the collection namedocuments - the documents to be inserted, can be emptyprotected void insertDocuments(String dbName, String collectionName, org.bson.Document... documents)
dbName - the database namecollectionName - the collection namedocuments - the documents to be inserted, can be emptyprotected void insertDocumentsInTx(String dbName, String collectionName, org.bson.Document... documents)
dbName - the database namecollectionName - the collection namedocuments - the documents to be inserted, can be emptyprotected void updateDocument(String dbName, String collectionName, org.bson.Document filter, org.bson.Document document)
dbName - the database namecollectionName - the collection namefilter - the document filterdocument - the document fields to be updatedprotected void deleteDocuments(String dbName, String collectionName, org.bson.Document filter)
dbName - the database namecollectionName - the collection namefilter - the document filterprotected io.debezium.connector.mongodb.ConnectionContext.MongoPrimary primary()
protected BiConsumer<String,Throwable> connectionErrorHandler(int numErrorsBeforeFailing)
private static boolean collectionExists(com.mongodb.client.MongoDatabase database,
String collectionName)
protected void storeDocuments(String dbName, String collectionName, String pathOnClasspath)
protected void storeDocuments(com.mongodb.client.MongoCollection<org.bson.Document> collection,
String pathOnClasspath)
Copyright © 2020 JBoss by Red Hat. All rights reserved.