LocalTimeConverter implements TypeConverter<String, LocalTime> { @Override public LocalTime convert(String value) { return LocalTime.parse(value); }  @Override LocalTime convert(String value);  }
@Test public void whenInputValueIsValid_ThenShouldReturnValidLocalTime() { String time = "10:15:20"; LocalTime expectedTime = LocalTime.of(10, 15, 20); LocalTime convertedTime = converter.convert(time); assertThat(convertedTime).isEqualTo(expectedTime); }
@Test(expected = DateTimeParseException.class) public void whenValueIsInvalid_ThenShouldThrowADateTimeParseException() { converter.convert("foo"); }