1 package com.fermod.util;
3 import static org.junit.Assume.assumeNoException;
4 import static org.junit.Assume.assumeNotNull;
6 import java.time.LocalDate;
7 import java.time.ZoneId;
10 import org.junit.jupiter.api.TestInfo;
28 date = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
29 }
catch (Exception e) {
30 assumeNoException(
"Exception thrown when trying to parse date.", e);
44 StringBuilder sb =
new StringBuilder();
45 sb.append(
"Unexpected exception thrown");
46 if(testInfo.getTestMethod().isPresent()) {
47 sb.append(
" in " + testInfo.getTestMethod().get().getName());
49 sb.append(
"\n\tCase: " + testInfo.getDisplayName());
static Date parseToDate(LocalDate localDate)
Parse java.util.Date to java.time.LocalDate.
static String getFailMessage(Exception e, TestInfo testInfo)
Returns a formated error message with the exception information.