@Test(expectedExceptions = SerializationException.class) public void testErrorSerialize() throws SerializationException { ClassWithPrivateFields classWithPrivateFields = new ClassWithPrivateFields(1, "John"); JsonUtil.serialize(classWithPrivateFields); }
public static String serialize(Object obj) throws SerializationException { try { if (obj != null) { return mapper.writeValueAsString(obj); } else { return null; } } catch (Exception e) { logger.error("SerializationException {}", e.getMessage()); throw new SerializationException(e.getMessage()); } }
JsonUtil { public static String serialize(Object obj) throws SerializationException { try { if (obj != null) { return mapper.writeValueAsString(obj); } else { return null; } } catch (Exception e) { logger.error("SerializationException {}", e.getMessage()); throw new SerializationException(e.getMessage()); } } }
JsonUtil { public static String serialize(Object obj) throws SerializationException { try { if (obj != null) { return mapper.writeValueAsString(obj); } else { return null; } } catch (Exception e) { logger.error("SerializationException {}", e.getMessage()); throw new SerializationException(e.getMessage()); } }  }
JsonUtil { public static String serialize(Object obj) throws SerializationException { try { if (obj != null) { return mapper.writeValueAsString(obj); } else { return null; } } catch (Exception e) { logger.error("SerializationException {}", e.getMessage()); throw new SerializationException(e.getMessage()); } }  static String serialize(Object obj); static Object deserialize(String json, TypeReference<?> typeReference); }
JsonUtil { public static String serialize(Object obj) throws SerializationException { try { if (obj != null) { return mapper.writeValueAsString(obj); } else { return null; } } catch (Exception e) { logger.error("SerializationException {}", e.getMessage()); throw new SerializationException(e.getMessage()); } }  static String serialize(Object obj); static Object deserialize(String json, TypeReference<?> typeReference); static ObjectMapper mapper; static final String TIMEZONE_UTC; static final String DATETIMEFORMAT; }