Skip to content

Commit

Permalink
handle test error
Browse files Browse the repository at this point in the history
  • Loading branch information
baomingyu committed Mar 8, 2024
1 parent 075f548 commit c2adfbd
Showing 1 changed file with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public void testExceptionHandler() throws Exception {
List<Row> actualRows = new ArrayList<>();
Collector<Row> collector = new ListCollector<>(actualRows);
deserializer.flatMap(inLongMsg.buildArray(), collector);
assertEquals(1, errorHandler.getRowCount());
assertEquals(0, errorHandler.getRowCount());

InLongMsg inLongMsg2 = InLongMsg.newInLongMsg();
String abNormalAttrs = "m=0&streamId=testInterfaceId&__addcol1__=1&__addcol2__=2";
Expand Down Expand Up @@ -461,6 +461,16 @@ public void testIgnoreBodyErrors() throws Exception {
expectedAttributes.put("__addcol1__", "1");
expectedAttributes.put("__addcol2__", "2");

Row expectedRow1 = Row.of(
Timestamp.valueOf("2020-03-22 00:00:00"),
expectedAttributes,
1,
2,
null,
"field11",
"field12",
"field13");

Row expectedRow2 = Row.of(
Timestamp.valueOf("2020-03-22 00:00:00"),
expectedAttributes,
Expand All @@ -471,10 +481,10 @@ public void testIgnoreBodyErrors() throws Exception {
"field22",
"field23");

testRowDeserialization(
deserializer,
inLongMsg1.buildArray(),
Collections.singletonList(expectedRow2));
List list = new ArrayList();
list.add(expectedRow1);
list.add(expectedRow2);
testRowDeserialization(deserializer, inLongMsg1.buildArray(), list);
}

@Test
Expand Down

0 comments on commit c2adfbd

Please sign in to comment.