@Test public void testUnableToJson() { final BadData badData = new BadData(); assertEquals("aaa", badData.getData()); assertEquals("{}", JsonUtil.toJson(badData)); }
public static <T> String toJson(final T object) { try { return OBJECT_MAPPER.writeValueAsString(object); } catch (JsonProcessingException e) { e.printStackTrace(); } return "{}"; }
JsonUtil { public static <T> String toJson(final T object) { try { return OBJECT_MAPPER.writeValueAsString(object); } catch (JsonProcessingException e) { e.printStackTrace(); } return "{}"; } }
JsonUtil { public static <T> String toJson(final T object) { try { return OBJECT_MAPPER.writeValueAsString(object); } catch (JsonProcessingException e) { e.printStackTrace(); } return "{}"; }  }
JsonUtil { public static <T> String toJson(final T object) { try { return OBJECT_MAPPER.writeValueAsString(object); } catch (JsonProcessingException e) { e.printStackTrace(); } return "{}"; }  static ObjectMapper getObjectMapper(); static String toJson(final T object); static String toPrettyJson(final T object); }
JsonUtil { public static <T> String toJson(final T object) { try { return OBJECT_MAPPER.writeValueAsString(object); } catch (JsonProcessingException e) { e.printStackTrace(); } return "{}"; }  static ObjectMapper getObjectMapper(); static String toJson(final T object); static String toPrettyJson(final T object);  }