@Test public void testSerialize() throws SerializationException { Card card = new Card.Builder().number("12345").build(); String cardStr = JsonUtil.serialize(card); Assert.assertNotNull(cardStr); String result = "{" + System.lineSeparator() + " \"number\" : \"12345\"" + System.lineSeparator() + "}"; Assert.assertEquals(cardStr, result); }
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; }