Skip to content

Instantly share code, notes, and snippets.

@tkobayas
Created December 26, 2016 00:52
Show Gist options
  • Save tkobayas/97c8d8af65403cf0d7791d8ec02087b3 to your computer and use it in GitHub Desktop.
Save tkobayas/97c8d8af65403cf0d7791d8ec02087b3 to your computer and use it in GitHub Desktop.
@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