@Test public void noBeanValidationShouldRaise() { LocalDate yesterday = LocalDate.now().minusDays(1); String json = String.format("{\"name\":\"Getu\", \"age\": 20, \"socialMedia\": 3, \"birth\": \"%s\", \"email\": \"heimdall@heimdall.com\"}", yesterday.toString()); PersonJsonTest person = subject.parse(json , PersonJsonTest.class); assertThat(person, hasProperty("name", is("Getu"))); assertThat(person, hasProperty("age", is(20))); assertThat(person, hasProperty("socialMedia", is(3))); assertThat(person, hasProperty("birth", is(yesterday))); assertThat(person, hasProperty("email", is("heimdall@heimdall.com"))); }
public String parse(Map<String, Object> body) { try { String json = mapper().writeValueAsString(body); return json; } catch (JsonProcessingException e) { log.error(e.getMessage(), e); return null; } }
JsonImpl implements Json { public String parse(Map<String, Object> body) { try { String json = mapper().writeValueAsString(body); return json; } catch (JsonProcessingException e) { log.error(e.getMessage(), e); return null; } } }
JsonImpl implements Json { public String parse(Map<String, Object> body) { try { String json = mapper().writeValueAsString(body); return json; } catch (JsonProcessingException e) { log.error(e.getMessage(), e); return null; } }  }
JsonImpl implements Json { public String parse(Map<String, Object> body) { try { String json = mapper().writeValueAsString(body); return json; } catch (JsonProcessingException e) { log.error(e.getMessage(), e); return null; } }  String parse(Map<String, Object> body); String parse(String string); String parse(T object); T parse(String json, Class<?> classType); @Override T parse(String json, TypeReference<T> type); T parse(String json, Class<?> parametrized, Class<?>... parameterClasses); Map<String, Object> parseToMap(T object); boolean isJson(String string); }
JsonImpl implements Json { public String parse(Map<String, Object> body) { try { String json = mapper().writeValueAsString(body); return json; } catch (JsonProcessingException e) { log.error(e.getMessage(), e); return null; } }  String parse(Map<String, Object> body); String parse(String string); String parse(T object); T parse(String json, Class<?> classType); @Override T parse(String json, TypeReference<T> type); T parse(String json, Class<?> parametrized, Class<?>... parameterClasses); Map<String, Object> parseToMap(T object); boolean isJson(String string);  }