QueryParamHelper { public static String toString(Number value) { if (value == null) return null; return value.toString(); }  static String toString(Number value); static String toString(Boolean value); static String toString(LocalDateTime dateTime); static String toString(LocalDate date); static String toString(LocalTime time); static String toString(ZonedDateTime dateTime); static String toString(T enumValue); static String toString(String value); static Integer toInt(String value); static Long toLong(String value); static Double toDouble(String value); static BigDecimal toBigDecimal(String value); static Boolean toBoolean(String value); static T toEnum(String value, Class<T> valueClass); static ZonedDateTime toZonedDateTime(String value); static LocalDateTime toDateTime(String value); static LocalTime toTime(String value); static LocalDate toDate(String value);  }
@Test void toStringWithString() { assertThat(QueryParamHelper.toString("")).as("empty string will be treated as null").isNull(); assertThat(QueryParamHelper.toString(" ")).isEqualTo(" "); assertThat(QueryParamHelper.toString("value")).isEqualTo("value"); }
@Test void toStringWithDate() { assertThat(QueryParamHelper.toString(LocalDate.of(2020, Month.JULY, 31))).isEqualTo("2020-07-31"); assertThat(QueryParamHelper.toString(ZonedDateTime.of(LocalDateTime.of(2020, Month.JULY, 31, 12, 0, 0), ZoneId.of("UTC")))).isEqualTo("2020-07-31T12:00:00Z"); }