CheneyYin commented on code in PR #5919:
URL: https://github.com/apache/seatunnel/pull/5919#discussion_r1410581868


##########
seatunnel-formats/seatunnel-format-json/src/test/java/org/apache/seatunnel/format/json/canal/CanalJsonSerDeSchemaTest.java:
##########
@@ -69,6 +73,85 @@ public void testDeserializeNullRow() throws Exception {
         assertEquals(0, collector.list.size());
     }
 
+    @Test
+    public void testDeserializeNoJson() throws Exception {
+        final CanalJsonDeserializationSchema deserializationSchema =
+                createCanalJsonDeserializationSchema(null, null);
+        final SimpleCollector collector = new SimpleCollector();
+        String noJsonMsg = "{]";
+
+        SeaTunnelRuntimeException expected = 
CommonError.jsonOperationError(FORMAT, noJsonMsg);
+        assertThrows(
+                expected.getClass(),
+                () -> {
+                    deserializationSchema.deserialize(noJsonMsg.getBytes(), 
collector);
+                },
+                expected.getMessage());
+    }

Review Comment:
   Yes, you are right.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to