Package io.debezium.connector.mongodb
Class NotificationsIT
java.lang.Object
io.debezium.embedded.AbstractConnectorTest
io.debezium.connector.mongodb.AbstractMongoConnectorIT
io.debezium.connector.mongodb.NotificationsIT
- All Implemented Interfaces:
Testing
Test to verify notifications for MongoDB.
- Author:
- Mario Fiore Vitale
-
Nested Class Summary
Nested ClassesNested 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 TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate static final Stringprotected static final intFields inherited from class io.debezium.connector.mongodb.AbstractMongoConnectorIT
config, context, logInterceptor, mongoFields inherited from class io.debezium.embedded.AbstractConnectorTest
consumedLines, engine, isEngineRunning, logger, logTestName, OFFSET_STORE_PATH, pollTimeoutInMs, skipTestRule -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafter()private voidassertTableNotificationsSentToJmx(List<Notification> notifications, String tableName) private voidassertTableNotificationsSentToTopic(List<org.apache.kafka.connect.source.SourceRecord> notifications, String tableName) voidbefore()protected Configuration.Builderconfig()protected Class<io.debezium.connector.mongodb.MongoDbConnector>voidprotected Stringprotected intprivate ObjectNamevoidvoidvoidprivate MBeanNotificationInfo[]private List<Notification>private List<Notification>voidprivate voidprotected voidstartConnector(Function<Configuration.Builder, Configuration.Builder> custConfig) protected voidstartConnector(Function<Configuration.Builder, Configuration.Builder> custConfig, io.debezium.engine.DebeziumEngine.CompletionCallback callback) Methods inherited from class io.debezium.connector.mongodb.AbstractMongoConnectorIT
afterAll, afterEach, beforeAll, beforeEach, connect, deleteDocuments, dropAndInsertDocuments, getSnapshotMetricsObjectName, getSnapshotMetricsObjectName, getStreamingMetricsObjectName, getStreamingMetricsObjectName, insertDocuments, insertDocumentsInTx, loadTestDocuments, storeDocuments, storeDocuments, 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, createEngine, createEngineBuilder, debug, getConsumer, 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, storeOffsets, validate, waitForAvailableRecords, waitForConnectorShutdown, waitForEngineShutdown, waitForSnapshotToBeCompleted, waitForSnapshotWithCustomMetricsToBeCompleted, waitForStreamingRunning, waitForStreamingRunning, waitForStreamingWithCustomMetricsToStart, waitTimeForEngine, waitTimeForRecords, waitTimeForRecordsAfterNulls
-
Field Details
-
ROW_COUNT
protected static final int ROW_COUNT- See Also:
-
DATABASE_NAME
- See Also:
-
COLLECTION_NAME
- See Also:
-
FULL_COLLECTION_NAME
- See Also:
-
-
Constructor Details
-
NotificationsIT
public NotificationsIT()
-
-
Method Details
-
before
public void before() -
after
public void after() -
connectorClass
-
config
-
fullDataCollectionName
-
startConnector
-
startConnector
protected void startConnector(Function<Configuration.Builder, Configuration.Builder> custConfig, io.debezium.engine.DebeziumEngine.CompletionCallback callback) -
notificationCorrectlySentOnItsTopic
public void notificationCorrectlySentOnItsTopic() -
notificationNotSentIfNoChannelIsConfigured
public void notificationNotSentIfNoChannelIsConfigured() -
reportErrorWhenSinkChannelIsEnabledAndNoTopicConfigurationProvided
public void reportErrorWhenSinkChannelIsEnabledAndNoTopicConfigurationProvided() -
notificationCorrectlySentOnJmx
public void notificationCorrectlySentOnJmx() throws ReflectionException, MalformedObjectNameException, InstanceNotFoundException, IntrospectionException, AttributeNotFoundException, MBeanException -
emittingDebeziumNotificationWillGenerateAJmxNotification
public void emittingDebeziumNotificationWillGenerateAJmxNotification() throws ReflectionException, MalformedObjectNameException, InstanceNotFoundException, IntrospectionException, AttributeNotFoundException, MBeanException, InterruptedException, com.fasterxml.jackson.core.JsonProcessingException- Throws:
ReflectionExceptionMalformedObjectNameExceptionInstanceNotFoundExceptionIntrospectionExceptionAttributeNotFoundExceptionMBeanExceptionInterruptedExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
assertTableNotificationsSentToJmx
-
assertTableNotificationsSentToTopic
-
readNotificationFromJmx
private List<Notification> readNotificationFromJmx() throws MalformedObjectNameException, ReflectionException, InstanceNotFoundException, IntrospectionException, AttributeNotFoundException, MBeanException -
readJmxNotifications
private MBeanNotificationInfo[] readJmxNotifications() throws MalformedObjectNameException, ReflectionException, InstanceNotFoundException, IntrospectionException, AttributeNotFoundException, MBeanException -
getObjectName
- Throws:
MalformedObjectNameException
-
registerJmxNotificationListener
private List<Notification> registerJmxNotificationListener() throws MalformedObjectNameException, InstanceNotFoundException -
resetNotifications
private void resetNotifications() throws MalformedObjectNameException, ReflectionException, InstanceNotFoundException, MBeanException -
getMaximumEnqueuedRecordCount
protected int getMaximumEnqueuedRecordCount()- Overrides:
getMaximumEnqueuedRecordCountin classAbstractConnectorTest
-