Class MongoDbConnectorIT

    • Field Detail

      • context

        private io.debezium.connector.mongodb.MongoDbTaskContext context
    • Constructor Detail

      • MongoDbConnectorIT

        public MongoDbConnectorIT()
    • Method Detail

      • beforeEach

        public void beforeEach()
      • afterEach

        public void afterEach()
      • shouldNotStartWithInvalidConfiguration

        public void shouldNotStartWithInvalidConfiguration()
        Verifies that the connector doesn't run with an invalid configuration. This does not actually connect to the MySQL 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

        public void shouldValidateFilterFieldConfiguration​(Field field,
                                                           String value,
                                                           int errorCount)
      • shouldValidateAcceptableConfiguration

        public void shouldValidateAcceptableConfiguration()
      • testEmptySchemaWarningAfterApplyingCollectionFilters

        @FixFor("DBZ-1242")
        public void testEmptySchemaWarningAfterApplyingCollectionFilters()
                                                                  throws Exception
        Throws:
        Exception
      • verifyFromInitialSync

        protected void verifyFromInitialSync​(org.apache.kafka.connect.source.SourceRecord record,
                                             AtomicBoolean foundLast)
      • shouldSnapshotDocumentContainingFieldNamedOp

        @FixFor("DBZ-2116")
        public void shouldSnapshotDocumentContainingFieldNamedOp()
                                                          throws Exception
        Throws:
        Exception
      • shouldFilterItemsInCollectionWhileTakingSnapshot

        @FixFor("DBZ-2496")
        public void shouldFilterItemsInCollectionWhileTakingSnapshot()
                                                              throws Exception
        Throws:
        Exception
      • verifyNotFromInitialSync

        protected void verifyNotFromInitialSync​(org.apache.kafka.connect.source.SourceRecord record)
      • verifyFromTransaction

        protected void verifyFromTransaction​(org.apache.kafka.connect.source.SourceRecord record,
                                             long order)
      • verifyNotFromTransaction

        protected void verifyNotFromTransaction​(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)
      • primary

        protected io.debezium.connector.mongodb.ConnectionContext.MongoPrimary primary()
      • storeDocuments

        protected void storeDocuments​(String dbName,
                                      String collectionName,
                                      String pathOnClasspath)
      • storeDocuments

        protected void storeDocuments​(com.mongodb.client.MongoCollection<org.bson.Document> collection,
                                      String pathOnClasspath)
      • storeDocumentsInTx

        protected void storeDocumentsInTx​(String dbName,
                                          String collectionName,
                                          String pathOnClasspath)
      • storeDocuments

        protected void storeDocuments​(com.mongodb.client.ClientSession session,
                                      com.mongodb.client.MongoCollection<org.bson.Document> collection,
                                      String pathOnClasspath)
      • loadTestDocuments

        protected List<org.bson.Document> loadTestDocuments​(String pathOnClasspath)
      • shouldOutputRecordsInCloudEventsFormat

        @FixFor("DBZ-1292")
        public void shouldOutputRecordsInCloudEventsFormat()
                                                    throws Exception
        Throws:
        Exception
      • shouldGenerateRecordForInsertEvent

        public void shouldGenerateRecordForInsertEvent()
                                                throws Exception
        Throws:
        Exception
      • shouldGenerateRecordForUpdateEvent

        public void shouldGenerateRecordForUpdateEvent()
                                                throws Exception
        Throws:
        Exception
      • shouldGeneratorRecordForDeleteEvent

        public void shouldGeneratorRecordForDeleteEvent()
                                                 throws Exception
        Throws:
        Exception
      • shouldGenerateRecordForDeleteEventWithoutTombstone

        @FixFor("DBZ-582")
        public void shouldGenerateRecordForDeleteEventWithoutTombstone()
                                                                throws Exception
        Throws:
        Exception
      • shouldGenerateRecordsWithCorrectlySerializedId

        public void shouldGenerateRecordsWithCorrectlySerializedId()
                                                            throws Exception
        Throws:
        Exception
      • assertSourceRecordKeyFieldIsEqualTo

        private static void assertSourceRecordKeyFieldIsEqualTo​(org.apache.kafka.connect.source.SourceRecord record,
                                                                String fieldName,
                                                                String expected)
      • shouldSupportDbRef2

        public void shouldSupportDbRef2()
                                 throws Exception
        Throws:
        Exception
      • shouldReplicateContent

        public void shouldReplicateContent()
                                    throws Exception
        Throws:
        Exception
      • shouldNotReplicateSnapshot

        public void shouldNotReplicateSnapshot()
                                        throws Exception
        Throws:
        Exception
      • shouldGenerateRecordForUpdateEventUsingLegacyV1SourceInfo

        @FixFor("DBZ-1880")
        public void shouldGenerateRecordForUpdateEventUsingLegacyV1SourceInfo()
                                                                       throws Exception
        Throws:
        Exception
      • formatObjectId

        private String formatObjectId​(org.bson.types.ObjectId objId)
      • insertDocuments

        private void insertDocuments​(String dbName,
                                     String collectionName,
                                     org.bson.Document... documents)
      • updateDocuments

        private void updateDocuments​(String dbName,
                                     String collectionName,
                                     org.bson.Document filter,
                                     org.bson.Document document)
      • deleteDocument

        private void deleteDocument​(String dbName,
                                    String collectionName,
                                    org.bson.types.ObjectId objectId)
      • toObjectId

        private org.bson.types.ObjectId toObjectId​(String oid)