Class FieldRenamesIT

    • Constructor Detail

      • FieldRenamesIT

        public FieldRenamesIT()
    • Method Detail

      • shouldNotRenameMissingFieldsForReadEvent

        public void shouldNotRenameMissingFieldsForReadEvent()
                                                      throws Exception
        Throws:
        Exception
      • shouldNotRenameNestedMissingFieldsForReadEvent

        public void shouldNotRenameNestedMissingFieldsForReadEvent()
                                                            throws Exception
        Throws:
        Exception
      • shouldNotRenameMissingFieldsForInsertEvent

        public void shouldNotRenameMissingFieldsForInsertEvent()
                                                        throws Exception
        Throws:
        Exception
      • shouldNotRenameNestedMissingFieldsForInsertEvent

        public void shouldNotRenameNestedMissingFieldsForInsertEvent()
                                                              throws Exception
        Throws:
        Exception
      • shouldNotRenameNestedMissingFieldsForUpdateEventWithEmbeddedDocument

        public void shouldNotRenameNestedMissingFieldsForUpdateEventWithEmbeddedDocument()
                                                                                  throws Exception
        Throws:
        Exception
      • shouldNotRenameFieldsForEventOfOtherCollection

        public void shouldNotRenameFieldsForEventOfOtherCollection()
                                                            throws Exception
        Throws:
        Exception
      • shouldRenameFieldsForReadEvent

        public void shouldRenameFieldsForReadEvent()
                                            throws Exception
        Throws:
        Exception
      • shouldRenameNestedFieldsForReadEvent

        public void shouldRenameNestedFieldsForReadEvent()
                                                  throws Exception
        Throws:
        Exception
      • shouldNotRenameNestedFieldsToExistingNamesForReadEvent

        public void shouldNotRenameNestedFieldsToExistingNamesForReadEvent()
                                                                    throws Exception
        Throws:
        Exception
      • shouldRenameFieldsForInsertEvent

        public void shouldRenameFieldsForInsertEvent()
                                              throws Exception
        Throws:
        Exception
      • shouldRenameNestedFieldsForInsertEvent

        public void shouldRenameNestedFieldsForInsertEvent()
                                                    throws Exception
        Throws:
        Exception
      • shouldNotRenameNestedFieldsToExistingNamesForInsertEvent

        public void shouldNotRenameNestedFieldsToExistingNamesForInsertEvent()
                                                                      throws Exception
        Throws:
        Exception
      • shouldRenameFieldsForUpdateEvent

        public void shouldRenameFieldsForUpdateEvent()
                                              throws Exception
        Throws:
        Exception
      • shouldNotRenameMissingFieldsForUpdateEvent

        public void shouldNotRenameMissingFieldsForUpdateEvent()
                                                        throws Exception
        Throws:
        Exception
      • shouldRenameNestedFieldsForUpdateEventWithEmbeddedDocument

        public void shouldRenameNestedFieldsForUpdateEventWithEmbeddedDocument()
                                                                        throws Exception
        Throws:
        Exception
      • shouldNotRenameNestedFieldsToExistingNamesForUpdateEventWithEmbeddedDocument

        public void shouldNotRenameNestedFieldsToExistingNamesForUpdateEventWithEmbeddedDocument()
                                                                                          throws Exception
        Throws:
        Exception
      • shouldRenameNestedFieldsForUpdateEventWithArrayOfEmbeddedDocuments

        public void shouldRenameNestedFieldsForUpdateEventWithArrayOfEmbeddedDocuments()
                                                                                throws Exception
        Throws:
        Exception
      • shouldNotRenameNestedFieldsForUpdateEventWithArrayOfArrays

        public void shouldNotRenameNestedFieldsForUpdateEventWithArrayOfArrays()
                                                                        throws Exception
        Throws:
        Exception
      • shouldRenameFieldsForSetTopLevelFieldUpdateEvent

        public void shouldRenameFieldsForSetTopLevelFieldUpdateEvent()
                                                              throws Exception
        Throws:
        Exception
      • shouldNotRenameFieldsToExistingNamesForSetTopLevelFieldUpdateEvent

        public void shouldNotRenameFieldsToExistingNamesForSetTopLevelFieldUpdateEvent()
                                                                                throws Exception
        Throws:
        Exception
      • shouldRenameFieldsForUnsetTopLevelFieldUpdateEvent

        public void shouldRenameFieldsForUnsetTopLevelFieldUpdateEvent()
                                                                throws Exception
        Throws:
        Exception
      • shouldNotRenameFieldsToExistingNamesForUnsetTopLevelFieldUpdateEvent

        public void shouldNotRenameFieldsToExistingNamesForUnsetTopLevelFieldUpdateEvent()
                                                                                  throws Exception
        Throws:
        Exception
      • shouldRenameNestedFieldsForSetTopLevelFieldUpdateEventWithEmbeddedDocument

        public void shouldRenameNestedFieldsForSetTopLevelFieldUpdateEventWithEmbeddedDocument()
                                                                                        throws Exception
        Throws:
        Exception
      • shouldRenameNestedFieldsForSetTopLevelFieldUpdateEventWithArrayOfEmbeddedDocuments

        public void shouldRenameNestedFieldsForSetTopLevelFieldUpdateEventWithArrayOfEmbeddedDocuments()
                                                                                                throws Exception
        Throws:
        Exception
      • shouldNotRenameNestedFieldsForSetTopLevelFieldUpdateEventWithArrayOfArrays

        public void shouldNotRenameNestedFieldsForSetTopLevelFieldUpdateEventWithArrayOfArrays()
                                                                                        throws Exception
        Throws:
        Exception
      • shouldRenameNestedFieldsForSetNestedFieldUpdateEventWithEmbeddedDocument

        public void shouldRenameNestedFieldsForSetNestedFieldUpdateEventWithEmbeddedDocument()
                                                                                      throws Exception
        Throws:
        Exception
      • shouldRenameNestedFieldsForSetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments

        public void shouldRenameNestedFieldsForSetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments()
                                                                                              throws Exception
        Throws:
        Exception
      • shouldNotRenameNestedFieldsToExistingNamesForSetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments

        public void shouldNotRenameNestedFieldsToExistingNamesForSetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments()
                                                                                                                throws Exception
        Throws:
        Exception
      • shouldNotRenameNestedFieldsForSetNestedFieldUpdateEventWithArrayOfArrays

        public void shouldNotRenameNestedFieldsForSetNestedFieldUpdateEventWithArrayOfArrays()
                                                                                      throws Exception
        Throws:
        Exception
      • shouldRenameNestedFieldsForSetNestedFieldUpdateEventWithSeveralArrays

        public void shouldRenameNestedFieldsForSetNestedFieldUpdateEventWithSeveralArrays()
                                                                                   throws Exception
        Throws:
        Exception
      • shouldRenameFieldsForSetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments

        public void shouldRenameFieldsForSetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments()
                                                                                        throws Exception
        Throws:
        Exception
      • shouldRenameFieldsForSetToArrayFieldUpdateEventWithArrayOfEmbeddedDocuments

        public void shouldRenameFieldsForSetToArrayFieldUpdateEventWithArrayOfEmbeddedDocuments()
                                                                                         throws Exception
        Throws:
        Exception
      • shouldRenameNestedFieldsForUnsetNestedFieldUpdateEventWithEmbeddedDocument

        public void shouldRenameNestedFieldsForUnsetNestedFieldUpdateEventWithEmbeddedDocument()
                                                                                        throws Exception
        Throws:
        Exception
      • shouldRenameNestedFieldsForUnsetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments

        public void shouldRenameNestedFieldsForUnsetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments()
                                                                                                throws Exception
        Throws:
        Exception
      • shouldNotRenameNestedFieldsToExistingNamesForUnsetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments

        public void shouldNotRenameNestedFieldsToExistingNamesForUnsetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments()
                                                                                                                  throws Exception
        Throws:
        Exception
      • shouldNotRenameNestedFieldsForUnsetNestedFieldUpdateEventWithArrayOfArrays

        public void shouldNotRenameNestedFieldsForUnsetNestedFieldUpdateEventWithArrayOfArrays()
                                                                                        throws Exception
        Throws:
        Exception
      • shouldRenameNestedFieldsForUnsetNestedFieldUpdateEventWithSeveralArrays

        public void shouldRenameNestedFieldsForUnsetNestedFieldUpdateEventWithSeveralArrays()
                                                                                     throws Exception
        Throws:
        Exception
      • shouldRenameFieldsForUnsetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments

        public void shouldRenameFieldsForUnsetNestedFieldUpdateEventWithArrayOfEmbeddedDocuments()
                                                                                          throws Exception
        Throws:
        Exception
      • shouldRenameFieldsForDeleteEvent

        public void shouldRenameFieldsForDeleteEvent()
                                              throws Exception
        Throws:
        Exception
      • shouldRenameFieldsForDeleteTombstoneEvent

        public void shouldRenameFieldsForDeleteTombstoneEvent()
                                                       throws Exception
        Throws:
        Exception
      • getFilterFromId

        private static org.bson.Document getFilterFromId​(org.bson.types.ObjectId id)
      • getDocumentFromUpdateRecord

        private static org.bson.Document getDocumentFromUpdateRecord​(org.apache.kafka.connect.data.Struct value)
      • getReadRecord

        private org.apache.kafka.connect.source.SourceRecord getReadRecord​(String fieldRenames,
                                                                           org.bson.Document document)
                                                                    throws Exception
        Throws:
        Exception
      • getReadRecord

        private org.apache.kafka.connect.source.SourceRecord getReadRecord​(String database,
                                                                           String collection,
                                                                           String fieldRenames,
                                                                           org.bson.Document document)
                                                                    throws Exception
        Throws:
        Exception
      • getInsertRecord

        private org.apache.kafka.connect.source.SourceRecord getInsertRecord​(String fieldRenames,
                                                                             org.bson.Document document)
                                                                      throws Exception
        Throws:
        Exception
      • getInsertRecord

        private org.apache.kafka.connect.source.SourceRecord getInsertRecord​(String database,
                                                                             String collection,
                                                                             String fieldRenames,
                                                                             org.bson.Document document)
                                                                      throws Exception
        Throws:
        Exception
      • getUpdateRecord

        private org.apache.kafka.connect.source.SourceRecord getUpdateRecord​(String fieldRenames,
                                                                             org.bson.Document snapshot,
                                                                             org.bson.Document document)
                                                                      throws Exception
        Throws:
        Exception
      • getUpdateRecord

        private org.apache.kafka.connect.source.SourceRecord getUpdateRecord​(String database,
                                                                             String collection,
                                                                             String fieldRenames,
                                                                             org.bson.Document snapshot,
                                                                             org.bson.Document document)
                                                                      throws Exception
        Throws:
        Exception
      • assertDocumentContainsFieldError

        private void assertDocumentContainsFieldError​(String fieldName)
      • assertShouldNotRenameDuringRead

        private void assertShouldNotRenameDuringRead​(String renamesList,
                                                     org.bson.Document snapshot,
                                                     String fieldName)
                                              throws Exception
        Throws:
        Exception
      • assertShouldNotRenameDuringInsert

        private void assertShouldNotRenameDuringInsert​(String renamesList,
                                                       org.bson.Document document,
                                                       String fieldName)
                                                throws Exception
        Throws:
        Exception
      • assertShouldNotRenameDuringUpdate

        private void assertShouldNotRenameDuringUpdate​(String renamesList,
                                                       org.bson.Document snapshot,
                                                       org.bson.Document update,
                                                       boolean unset,
                                                       String fieldName)
                                                throws Exception
        Throws:
        Exception