public static Date parseDate(final String str) {
    try {
      return new Date(TimeUnit.DAYS.toMillis(
          LocalDate.parse(PartialStringToTimestampParser.completeDate(str))
          .toEpochDay()));
    } catch (DateTimeParseException e) {
      throw new KsqlException("Failed to parse date '" + str
          + "': " + e.getMessage()
          + DATE_HELP_MESSAGE,
          e
      );
    }
  }
@Test
  public void shouldNotParseDate() {
    // When:
    final KsqlException e = assertThrows(
        KsqlException.class,
        () -> SqlTimeTypes.parseDate("foo")
    );

    // Then
    assertThat(e.getMessage(), containsString(
        "Required format is: \"yyyy-MM-dd\""));
  }