elvyssoares

DurationValidatorTest - Refactored

May 19th, 2020
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. @Test
  2. public void returnsASetOfErrorsForAnObject() throws Exception {
  3.     assertThat(Locale.getDefault().getLanguage()).isEqualTo("en");
  4.  
  5.     final Collection<String> errors =
  6.         ConstraintViolations.format(validator.validate(new Example()));
  7.  
  8.     assertThat(errors)
  9.         .containsOnly(
  10.             "outOfRange must be between 10 MINUTES and 30 MINUTES",
  11.             "tooBig must be less than or equal to 30 SECONDS",
  12.             "tooBigExclusive must be less than 30 SECONDS");
  13. }
Add Comment
Please, Sign In to add comment