LocalDateConverter implements TypeConverter<String, LocalDate> { @Override public LocalDate convert(String value) { return LocalDate.parse(value); }  @Override LocalDate convert(String value);  }
@Test public void whenInputValueIsValid_ThenShouldReturnValidLocalDate() { String date = "2020-01-20"; LocalDate expectedDate = LocalDate.of(2020, 1, 20); LocalDate convertedDate = converter.convert(date); assertThat(convertedDate).isEqualTo(expectedDate); }
@Test(expected = DateTimeParseException.class) public void whenValueIsInvalid_ThenShouldThrowADateTimeParseException() { converter.convert("foo"); }