Search in sources :

Example 1 with Employee

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());
}
Also used : Employee(jodd.json.mock.Employee) DateJsonSerializer(jodd.json.impl.DateJsonSerializer) Person(jodd.json.mock.Person) Test(org.junit.Test)

Aggregations

DateJsonSerializer (jodd.json.impl.DateJsonSerializer)1 Employee (jodd.json.mock.Employee)1 Person (jodd.json.mock.Person)1 Test (org.junit.Test)1