User extends AbstractAuthzEntity { public Application getApplication() { return application; }  Application getApplication(); void setApplication(final Application application); Role getRole(); void setRole(final Role role); List<UserIdentity> getIdentities(); void setIdentities(final List<UserIdentity> identities); List<Application> getApplications(); void setApplications(final List<Application> applications); @Override @Transient @JsonIgnore User getOwner();  }
@Test public void testJacksonDeserializable() throws Exception { ObjectMapper m = new ObjectMapperFactory().get(); long timestamp = Calendar.getInstance().getTimeInMillis() / 1000; ObjectNode node = m.createObjectNode(); node.put("id", IdUtil.toString(IdUtil.next())); node.put("createdDate", timestamp); node.put("modifiedDate", timestamp); node.put("application", IdUtil.toString(IdUtil.next())); String output = m.writeValueAsString(node); User user = m.readValue(output, User.class); assertEquals( IdUtil.toString(user.getId()), node.get("id").asText()); assertEquals( user.getCreatedDate().getTimeInMillis() / 1000, node.get("createdDate").asLong()); assertEquals( user.getModifiedDate().getTimeInMillis() / 1000, node.get("modifiedDate").asLong()); assertEquals( IdUtil.toString(user.getApplication().getId()), node.get("application").asText()); }