rmannibucau commented on a change in pull request #53: JOHNZON-282: add support for @JsonbTypeAdapter at class level URL: https://github.com/apache/johnzon/pull/53#discussion_r328826796
########## File path: johnzon-jsonb/src/test/java/org/apache/johnzon/jsonb/AdapterTest.java ########## @@ -44,13 +47,21 @@ public void adapt() throws Exception { foo.bar.value = 1; foo.dummy = new Dummy(); foo.dummy.value = 2L; + foo.baz = new Baz(); + foo.baz.value = "3"; final String toString = jsonb.toJson(foo); - assertEquals("{\"bar\":\"1\",\"dummy\":\"2\"}", toString); + assertThat(toString, startsWith("{")); + assertThat(toString, containsString("\"bar\":\"1\"")); + assertThat(toString, containsString("\"dummy\":\"2\"")); + assertThat(toString, containsString("\"baz\":\"3\"")); + assertThat(toString, endsWith("}")); + assertEquals("{\"bar\":\"1\",\"dummy\":\"2\",\"baz\":\"3\"}".length(), toString.length()); final Foo read = jsonb.fromJson(toString, Foo.class); assertEquals(foo.bar.value, read.bar.value); assertEquals(foo.dummy.value, read.dummy.value); + assertEquals(foo.baz.value, read.baz.value); Review comment: I would also add a test where baz is the root object too, we had issues with that on other metadata by the past. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services