JSONObject person = (JSONObject)result.get("person");
JSONObject jsonObject = new JSONObject();
jsonObject.put("name", person.get("name"));
jsonObject.put("desc", person.get("desc"));
jsonObject.put("age", person.get("age"));
Person p =
(Person)jacksonProvider.readFrom(Object.class,
Person.class,
null,
MediaType.APPLICATION_JSON_TYPE,
null,
new ByteArrayInputStream(jsonObject.toString()
.getBytes()));
assertEquals("myName", p.getName());
assertEquals("myDescription", p.getDesc());
assertEquals(100, p.getAge());
}