ResourceInfo { public static ResourceInfo fromJson(ObjectMapper objectMapper, String json) { if (Strings.isNullOrEmpty(json)) { return null; } try { return objectMapper.readValue(json, ResourceInfo.class); } catch (IOException ex) { logger.error("Error while reading ResourceInfo object from JSON: {}", json, ex); return null; } } @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)  ResourceInfo(@JsonProperty("url") String url, @JsonProperty("type") String type, @JsonProperty("status") Integer status, @JsonProperty("lastChecked") Long lastChecked); Integer getStatus(); String getType(); String getUrl(); Long getLastChecked(); @Override String toString(); String toJson(ObjectMapper objectMapper); static ResourceInfo fromJson(ObjectMapper objectMapper, String json);  }
@Test public void testFromJson() { final ResourceInfo result = ResourceInfo.fromJson(objectMapper, JSON); assertEquals(RESOURCE_INFO.getUrl(), result.getUrl()); assertEquals(RESOURCE_INFO.getType(), result.getType()); assertEquals(RESOURCE_INFO.getStatus(), result.getStatus()); assertEquals(RESOURCE_INFO.getLastChecked(), result.getLastChecked()); }