opwvhk commented on code in PR #2529:
URL: https://github.com/apache/avro/pull/2529#discussion_r1347045264
##########
lang/java/avro/src/test/java/org/apache/avro/util/internal/TestJacksonUtils.java:
##########
@@ -102,4 +114,22 @@ void testToObject() {
assertEquals("a", toObject(TextNode.valueOf("a"),
SchemaBuilder.unionOf().stringType().and().intType().endUnion()));
}
+ @ParameterizedTest
+ @MethodSource("nodes")
+ void cycle(JsonNode input) {
+ Object object = JacksonUtils.toObject(input);
+ JsonNode node = JacksonUtils.toJsonNode(object);
+ Assertions.assertEquals(input, node);
+ }
+
+ public static Stream<Arguments> nodes() {
+ ObjectNode o1 = JsonNodeFactory.instance.objectNode();
+ o1.put("intField", 123);
Review Comment:
This is tricky. We can see in the tests that `int` and `long` are correctly
preserved by the tests here, so I think/hope we can assume the test is complete.
--
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]