public void testPropertyWithSubtypes() throws Exception
{
ObjectMapper mapper = new ObjectMapper();
// must register subtypes
mapper.registerSubtypes(SubB.class, SubC.class, SubD.class);
String json = mapper.writeValueAsString(new PropertyBean(new SubC()));
PropertyBean result = mapper.readValue(json, PropertyBean.class);
assertSame(SubC.class, result.value.getClass());
}
// [JACKSON-748]: also works via modules