public class AssertUtils extends Object
SourceRecord
and DebeziumSourceFunction
.Constructor and Description |
---|
AssertUtils() |
Modifier and Type | Method and 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. |
public static void assertInsert(org.apache.kafka.connect.source.SourceRecord record, boolean keyExpected)
SourceRecord
is a INSERT/CREATE
record.record
- the source record; may not be nullpublic static void assertRead(org.apache.kafka.connect.source.SourceRecord record)
SourceRecord
is a READ
record.record
- the source record; may not be nullpublic static void assertUpdate(org.apache.kafka.connect.source.SourceRecord record, boolean keyExpected)
SourceRecord
is a UPDATE
record.record
- the source record; may not be nullpublic static void assertDelete(org.apache.kafka.connect.source.SourceRecord record, boolean keyExpected)
SourceRecord
is a DELETE
record.record
- the source record; may not be nullpublic static void assertTombstone(org.apache.kafka.connect.source.SourceRecord record)
SourceRecord
is a valid tombstone, meaning it has a non-null
key and key schema but null value and value schema.record
- the source record; may not be nullpublic static void hasValidKey(org.apache.kafka.connect.source.SourceRecord record, String pkField, int pk)
SourceRecord
has a valid non-null integer key that matches the
expected integer value.record
- the source record; may not be nullpkField
- the single field defining the primary key of the struct; may not be nullpk
- the expected integer value of the primary key in the structpublic static void assertInsert(org.apache.kafka.connect.source.SourceRecord record)
SourceRecord
is a INSERT/CREATE
record without primary key.record
- the source record; may not be nullpublic static void assertInsert(org.apache.kafka.connect.source.SourceRecord record, String pkField, int pk)
SourceRecord
is a INSERT/CREATE
record, and that the integer key matches the expected value.record
- the source record; may not be nullpkField
- the single field defining the primary key of the struct; may not be nullpk
- the expected integer value of the primary key in the structpublic static void assertRead(org.apache.kafka.connect.source.SourceRecord record, String pkField, int pk)
SourceRecord
is a READ
record, and that the integer key matches the expected value.record
- the source record; may not be nullpkField
- the single field defining the primary key of the struct; may not be nullpk
- the expected integer value of the primary key in the structpublic static void assertUpdate(org.apache.kafka.connect.source.SourceRecord record)
SourceRecord
is a UPDATE
record without PK.record
- the source record; may not be nullpublic static void assertUpdate(org.apache.kafka.connect.source.SourceRecord record, String pkField, int pk)
SourceRecord
is a UPDATE
record, and that the integer key matches the expected value.record
- the source record; may not be nullpkField
- the single field defining the primary key of the struct; may not be nullpk
- the expected integer value of the primary key in the structpublic static void assertDelete(org.apache.kafka.connect.source.SourceRecord record)
SourceRecord
is a DELETE
record without PK. matches the expected value.record
- the source record; may not be nullpublic static void assertDelete(org.apache.kafka.connect.source.SourceRecord record, String pkField, int pk)
SourceRecord
is a DELETE
record, and that the integer key matches the expected value.record
- the source record; may not be nullpkField
- the single field defining the primary key of the struct; may not be nullpk
- the expected integer value of the primary key in the structpublic static void assertProducedTypeOfSourceFunction(DebeziumSourceFunction<org.apache.flink.table.data.RowData> debeziumSourceFunction, org.apache.flink.table.types.DataType expectedProducedType)
DebeziumSourceFunction<RowData>
matches
the resolved schema data type.debeziumSourceFunction
- the actual DebeziumSourceFunctionexpectedProducedType
- expected DataType of resolved schemaCopyright © 2024 The Apache Software Foundation. All rights reserved.