Class AssertUtils

    • Constructor Summary

      Constructors 
      Constructor Description
      AssertUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void assertDelete​(org.apache.kafka.connect.source.SourceRecord record)
      Verify that the given SourceRecord is a DELETE record without PK.
      static void assertDelete​(org.apache.kafka.connect.source.SourceRecord record, boolean keyExpected)
      Verify that the given SourceRecord is a DELETE record.
      static void assertDelete​(org.apache.kafka.connect.source.SourceRecord record, String pkField, int pk)
      Verify that the given SourceRecord is a DELETE record, and that the integer key matches the expected value.
      static void assertInsert​(org.apache.kafka.connect.source.SourceRecord record)
      Verify that the given SourceRecord is a INSERT/CREATE record without primary key.
      static void assertInsert​(org.apache.kafka.connect.source.SourceRecord record, boolean keyExpected)
      Verify that the given SourceRecord is a INSERT/CREATE record.
      static void assertInsert​(org.apache.kafka.connect.source.SourceRecord record, String pkField, int pk)
      Verify that the given SourceRecord is a INSERT/CREATE record, and that the integer key matches the expected value.
      static void assertProducedTypeOfSourceFunction​(DebeziumSourceFunction<org.apache.flink.table.data.RowData> debeziumSourceFunction, org.apache.flink.table.types.DataType expectedProducedType)
      Verify that the given produced data type of DebeziumSourceFunction<RowData> matches the resolved schema data type.
      static void assertRead​(org.apache.kafka.connect.source.SourceRecord record)
      Verify that the given SourceRecord is a READ record.
      static void assertRead​(org.apache.kafka.connect.source.SourceRecord record, String pkField, int pk)
      Verify that the given SourceRecord is a READ record, and that the integer key matches the expected value.
      static void assertTombstone​(org.apache.kafka.connect.source.SourceRecord record)
      Verify that the given SourceRecord is a valid tombstone, meaning it has a non-null key and key schema but null value and value schema.
      static void assertUpdate​(org.apache.kafka.connect.source.SourceRecord record)
      Verify that the given SourceRecord is a UPDATE record without PK.
      static void assertUpdate​(org.apache.kafka.connect.source.SourceRecord record, boolean keyExpected)
      Verify that the given SourceRecord is a UPDATE record.
      static void assertUpdate​(org.apache.kafka.connect.source.SourceRecord record, String pkField, int pk)
      Verify that the given SourceRecord is a UPDATE record, and that the integer key matches the expected value.
      static void hasValidKey​(org.apache.kafka.connect.source.SourceRecord record, String pkField, int pk)
      Verify that the given SourceRecord has a valid non-null integer key that matches the expected integer value.
    • Constructor Detail

      • AssertUtils

        public AssertUtils()
    • Method Detail

      • assertInsert

        public static void assertInsert​(org.apache.kafka.connect.source.SourceRecord record,
                                        boolean keyExpected)
        Verify that the given SourceRecord is a INSERT/CREATE record.
        Parameters:
        record - the source record; may not be null
      • assertRead

        public static void assertRead​(org.apache.kafka.connect.source.SourceRecord record)
        Verify that the given SourceRecord is a READ record.
        Parameters:
        record - the source record; may not be null
      • assertUpdate

        public static void assertUpdate​(org.apache.kafka.connect.source.SourceRecord record,
                                        boolean keyExpected)
        Verify that the given SourceRecord is a UPDATE record.
        Parameters:
        record - the source record; may not be null
      • assertDelete

        public static void assertDelete​(org.apache.kafka.connect.source.SourceRecord record,
                                        boolean keyExpected)
        Verify that the given SourceRecord is a DELETE record.
        Parameters:
        record - the source record; may not be null
      • assertTombstone

        public static void assertTombstone​(org.apache.kafka.connect.source.SourceRecord record)
        Verify that the given SourceRecord is a valid tombstone, meaning it has a non-null key and key schema but null value and value schema.
        Parameters:
        record - the source record; may not be null
      • hasValidKey

        public static void hasValidKey​(org.apache.kafka.connect.source.SourceRecord record,
                                       String pkField,
                                       int pk)
        Verify that the given SourceRecord has a valid non-null integer key that matches the expected integer value.
        Parameters:
        record - the source record; may not be null
        pkField - the single field defining the primary key of the struct; may not be null
        pk - the expected integer value of the primary key in the struct
      • assertInsert

        public static void assertInsert​(org.apache.kafka.connect.source.SourceRecord record)
        Verify that the given SourceRecord is a INSERT/CREATE record without primary key.
        Parameters:
        record - the source record; may not be null
      • assertInsert

        public static void assertInsert​(org.apache.kafka.connect.source.SourceRecord record,
                                        String pkField,
                                        int pk)
        Verify that the given SourceRecord is a INSERT/CREATE record, and that the integer key matches the expected value.
        Parameters:
        record - the source record; may not be null
        pkField - the single field defining the primary key of the struct; may not be null
        pk - the expected integer value of the primary key in the struct
      • assertRead

        public static void assertRead​(org.apache.kafka.connect.source.SourceRecord record,
                                      String pkField,
                                      int pk)
        Verify that the given SourceRecord is a READ record, and that the integer key matches the expected value.
        Parameters:
        record - the source record; may not be null
        pkField - the single field defining the primary key of the struct; may not be null
        pk - the expected integer value of the primary key in the struct
      • assertUpdate

        public static void assertUpdate​(org.apache.kafka.connect.source.SourceRecord record)
        Verify that the given SourceRecord is a UPDATE record without PK.
        Parameters:
        record - the source record; may not be null
      • assertUpdate

        public static void assertUpdate​(org.apache.kafka.connect.source.SourceRecord record,
                                        String pkField,
                                        int pk)
        Verify that the given SourceRecord is a UPDATE record, and that the integer key matches the expected value.
        Parameters:
        record - the source record; may not be null
        pkField - the single field defining the primary key of the struct; may not be null
        pk - the expected integer value of the primary key in the struct
      • assertDelete

        public static void assertDelete​(org.apache.kafka.connect.source.SourceRecord record)
        Verify that the given SourceRecord is a DELETE record without PK. matches the expected value.
        Parameters:
        record - the source record; may not be null
      • assertDelete

        public static void assertDelete​(org.apache.kafka.connect.source.SourceRecord record,
                                        String pkField,
                                        int pk)
        Verify that the given SourceRecord is a DELETE record, and that the integer key matches the expected value.
        Parameters:
        record - the source record; may not be null
        pkField - the single field defining the primary key of the struct; may not be null
        pk - the expected integer value of the primary key in the struct
      • assertProducedTypeOfSourceFunction

        public static void assertProducedTypeOfSourceFunction​(DebeziumSourceFunction<org.apache.flink.table.data.RowData> debeziumSourceFunction,
                                                              org.apache.flink.table.types.DataType expectedProducedType)
        Verify that the given produced data type of DebeziumSourceFunction<RowData> matches the resolved schema data type.
        Parameters:
        debeziumSourceFunction - the actual DebeziumSourceFunction
        expectedProducedType - expected DataType of resolved schema