JsonUtil { public static String toJsonString(Object obj) { try { return OBJECT_MAPPER.writeValueAsString(obj); } catch (JsonProcessingException e) { throw new RuntimeJsonMappingException(JsonMappingException.fromUnexpectedIOE(e)); } }  static String toJsonString(Object obj); static T readValue(InputStream inputStream, Class<T> clazz); static T readValue(byte[] bytes, Class<T> clazz); static byte[] writeBytes(Object object);  }
@Test public void toJsonString() throws Exception { assertThat(JsonUtil.toJsonString(TestBean.getTestBean())).isEqualTo("{\"string\":\"asdasd\",\"integer\":111,\"aLong\":111,\"map\":{\"a\":1}}"); }