use of jodd.json.mock.Employee in project jodd by oblac.
the class JSONDeserializerTest method testSubClassDeserialize.
@Test
public void testSubClassDeserialize() {
Employee dilbert = creator.createDilbert();
String json = new JsonSerializer().include("phones", "hobbies").serialize(dilbert);
Person jsonDilbert = new JsonParser().parse(json, Employee.class);
assertNotNull(jsonDilbert);
assertTrue(jsonDilbert instanceof Employee);
assertEquals(dilbert.getCompany(), ((Employee) jsonDilbert).getCompany());
}
Aggregations