@Test(expected = BeanValidationException.class) public void pastAnnotationShouldWork() { LocalDate tomorrow = LocalDate.now().plusDays(1); String json = String.format("{\"name\":\"Getu\", \"age\": 20, \"socialMedia\": 3, \"birth\": \"%s\"}", tomorrow.toString()); try { subject.parse(json , PersonJsonTest.class); } catch (BeanValidationException e) { List<BeanValidationErrorDTO> errors = subject.parse(e.getViolations(), new TypeReference<List<BeanValidationErrorDTO>>() {}); assertThat(errors, contains(hasProperty("attribute", is("birth")))); throw e; } }
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);  }