Created
December 26, 2016 00:52
-
-
Save tkobayas/97c8d8af65403cf0d7791d8ec02087b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testJSONTypeInfoTopLevelOnly() { | |
Marshaller marshaller = MarshallerFactory.getMarshaller( getCustomClasses(), MarshallingFormat.JSON, getClass().getClassLoader() ); | |
String rawContent = "{\"org.kie.server.api.marshalling.objects.PojoA\": " | |
+ "{\"name\": \"A\"," | |
+ " \"pojoBList\":" | |
+ " [{\"name\": \"B1\"," | |
+ " \"pojoCList\":" | |
+ " [" | |
+ " {\"name\": \"C1\"}, " | |
+ " {\"name\": \"C2\"}" | |
+ " ]" | |
+ " }," | |
+ " {\"name\": \"B2\"," | |
+ " \"pojoCList\":" | |
+ " [" | |
+ " {\"name\": \"C3\"}" | |
+ " ]" | |
+ " }" | |
+ " ]," | |
+ " \"stringList\":" | |
+ " [\"Hello\", \"Bye\"]" | |
+ "}}"; | |
Object testObjectAfterMarshallingTurnAround = marshaller.unmarshall( rawContent, PojoA.class ); | |
Assertions.assertThat( testObjectAfterMarshallingTurnAround ).isEqualTo( createTestObject() ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment