From 3e37e8c6a7aa186683ed46180dedbe9b43e9b751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Sucena=20Lopes?= Date: Sat, 26 Oct 2024 17:06:09 +0100 Subject: [PATCH] tests: fix date format --- .../pt/up/fe/ni/website/backend/utils/ValidationTester.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/kotlin/pt/up/fe/ni/website/backend/utils/ValidationTester.kt b/src/test/kotlin/pt/up/fe/ni/website/backend/utils/ValidationTester.kt index 170980cd..1ff0dc0e 100644 --- a/src/test/kotlin/pt/up/fe/ni/website/backend/utils/ValidationTester.kt +++ b/src/test/kotlin/pt/up/fe/ni/website/backend/utils/ValidationTester.kt @@ -1,6 +1,7 @@ package pt.up.fe.ni.website.backend.utils import java.time.LocalDate +import java.time.format.DateTimeFormatter import org.springframework.http.MediaType import org.springframework.test.web.servlet.ResultActions import org.springframework.test.web.servlet.result.MockMvcResultMatchers.content @@ -114,8 +115,10 @@ class ValidationTester( fun isPastDate() { // get the current date and offset it by 1 day + val timeFormatter = DateTimeFormatter.ofPattern("dd-MM-yyyy") val tomorrow = LocalDate.now() .plusDays(1) + .format(timeFormatter) .toString() val params = requiredFields.toMutableMap()