Skip to content

Commit

Permalink
[hotfix] fix canal-json UT
Browse files Browse the repository at this point in the history
  • Loading branch information
ashulin committed Feb 28, 2023
1 parent 2213f9f commit b0b8e96
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public final class SeaTunnelRow implements Serializable {
private static final long serialVersionUID = -1L;
/** Table identifier, used for the source connector that {@link SupportMultipleTable}. */
private String tableId;
private String tableId = "";
/** The kind of change that a row describes in a changelog. */
private RowKind kind = RowKind.INSERT;
/** The array to store the actual internal format values. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,32 +78,32 @@ public void runTest(List<String> lines, CanalJsonDeserializationSchema deseriali

List<String> expected =
Arrays.asList(
"SeaTunnelRow{tableId=-1, kind=+I, fields=[101, scooter, Small 2-wheel scooter, 3.14]}",
"SeaTunnelRow{tableId=-1, kind=+I, fields=[102, car battery, 12V car battery, 8.1]}",
"SeaTunnelRow{tableId=-1, kind=+I, fields=[103, 12-pack drill bits, 12-pack of drill bits with sizes ranging from #40 to #3, 0.8]}",
"SeaTunnelRow{tableId=-1, kind=+I, fields=[104, hammer, 12oz carpenter's hammer, 0.75]}",
"SeaTunnelRow{tableId=-1, kind=+I, fields=[105, hammer, 14oz carpenter's hammer, 0.875]}",
"SeaTunnelRow{tableId=-1, kind=+I, fields=[106, hammer, null, 1.0]}",
"SeaTunnelRow{tableId=-1, kind=+I, fields=[107, rocks, box of assorted rocks, 5.3]}",
"SeaTunnelRow{tableId=-1, kind=+I, fields=[108, jacket, water resistent black wind breaker, 0.1]}",
"SeaTunnelRow{tableId=-1, kind=+I, fields=[109, spare tire, 24 inch spare tire, 22.2]}",
"SeaTunnelRow{tableId=-1, kind=-U, fields=[106, hammer, null, 1.0]}",
"SeaTunnelRow{tableId=-1, kind=+U, fields=[106, hammer, 18oz carpenter hammer, 1.0]}",
"SeaTunnelRow{tableId=-1, kind=-U, fields=[107, rocks, box of assorted rocks, 5.3]}",
"SeaTunnelRow{tableId=-1, kind=+U, fields=[107, rocks, box of assorted rocks, 5.1]}",
"SeaTunnelRow{tableId=-1, kind=+I, fields=[110, jacket, water resistent white wind breaker, 0.2]}",
"SeaTunnelRow{tableId=-1, kind=+I, fields=[111, scooter, Big 2-wheel scooter , 5.18]}",
"SeaTunnelRow{tableId=-1, kind=-U, fields=[110, jacket, water resistent white wind breaker, 0.2]}",
"SeaTunnelRow{tableId=-1, kind=+U, fields=[110, jacket, new water resistent white wind breaker, 0.5]}",
"SeaTunnelRow{tableId=-1, kind=-U, fields=[111, scooter, Big 2-wheel scooter , 5.18]}",
"SeaTunnelRow{tableId=-1, kind=+U, fields=[111, scooter, Big 2-wheel scooter , 5.17]}",
"SeaTunnelRow{tableId=-1, kind=-D, fields=[111, scooter, Big 2-wheel scooter , 5.17]}",
"SeaTunnelRow{tableId=-1, kind=-U, fields=[101, scooter, Small 2-wheel scooter, 3.14]}",
"SeaTunnelRow{tableId=-1, kind=+U, fields=[101, scooter, Small 2-wheel scooter, 5.17]}",
"SeaTunnelRow{tableId=-1, kind=-U, fields=[102, car battery, 12V car battery, 8.1]}",
"SeaTunnelRow{tableId=-1, kind=+U, fields=[102, car battery, 12V car battery, 5.17]}",
"SeaTunnelRow{tableId=-1, kind=-D, fields=[102, car battery, 12V car battery, 5.17]}",
"SeaTunnelRow{tableId=-1, kind=-D, fields=[103, 12-pack drill bits, 12-pack of drill bits with sizes ranging from #40 to #3, 0.8]}");
"SeaTunnelRow{tableId=, kind=+I, fields=[101, scooter, Small 2-wheel scooter, 3.14]}",
"SeaTunnelRow{tableId=, kind=+I, fields=[102, car battery, 12V car battery, 8.1]}",
"SeaTunnelRow{tableId=, kind=+I, fields=[103, 12-pack drill bits, 12-pack of drill bits with sizes ranging from #40 to #3, 0.8]}",
"SeaTunnelRow{tableId=, kind=+I, fields=[104, hammer, 12oz carpenter's hammer, 0.75]}",
"SeaTunnelRow{tableId=, kind=+I, fields=[105, hammer, 14oz carpenter's hammer, 0.875]}",
"SeaTunnelRow{tableId=, kind=+I, fields=[106, hammer, null, 1.0]}",
"SeaTunnelRow{tableId=, kind=+I, fields=[107, rocks, box of assorted rocks, 5.3]}",
"SeaTunnelRow{tableId=, kind=+I, fields=[108, jacket, water resistent black wind breaker, 0.1]}",
"SeaTunnelRow{tableId=, kind=+I, fields=[109, spare tire, 24 inch spare tire, 22.2]}",
"SeaTunnelRow{tableId=, kind=-U, fields=[106, hammer, null, 1.0]}",
"SeaTunnelRow{tableId=, kind=+U, fields=[106, hammer, 18oz carpenter hammer, 1.0]}",
"SeaTunnelRow{tableId=, kind=-U, fields=[107, rocks, box of assorted rocks, 5.3]}",
"SeaTunnelRow{tableId=, kind=+U, fields=[107, rocks, box of assorted rocks, 5.1]}",
"SeaTunnelRow{tableId=, kind=+I, fields=[110, jacket, water resistent white wind breaker, 0.2]}",
"SeaTunnelRow{tableId=, kind=+I, fields=[111, scooter, Big 2-wheel scooter , 5.18]}",
"SeaTunnelRow{tableId=, kind=-U, fields=[110, jacket, water resistent white wind breaker, 0.2]}",
"SeaTunnelRow{tableId=, kind=+U, fields=[110, jacket, new water resistent white wind breaker, 0.5]}",
"SeaTunnelRow{tableId=, kind=-U, fields=[111, scooter, Big 2-wheel scooter , 5.18]}",
"SeaTunnelRow{tableId=, kind=+U, fields=[111, scooter, Big 2-wheel scooter , 5.17]}",
"SeaTunnelRow{tableId=, kind=-D, fields=[111, scooter, Big 2-wheel scooter , 5.17]}",
"SeaTunnelRow{tableId=, kind=-U, fields=[101, scooter, Small 2-wheel scooter, 3.14]}",
"SeaTunnelRow{tableId=, kind=+U, fields=[101, scooter, Small 2-wheel scooter, 5.17]}",
"SeaTunnelRow{tableId=, kind=-U, fields=[102, car battery, 12V car battery, 8.1]}",
"SeaTunnelRow{tableId=, kind=+U, fields=[102, car battery, 12V car battery, 5.17]}",
"SeaTunnelRow{tableId=, kind=-D, fields=[102, car battery, 12V car battery, 5.17]}",
"SeaTunnelRow{tableId=, kind=-D, fields=[103, 12-pack drill bits, 12-pack of drill bits with sizes ranging from #40 to #3, 0.8]}");
List<String> actual =
collector.list.stream().map(Object::toString).collect(Collectors.toList());
assertEquals(expected, actual);
Expand Down

0 comments on commit b0b8e96

Please sign in to comment.