From ad7f2ecb156eea99572ef454979258379fd5e27a Mon Sep 17 00:00:00 2001 From: "Kristen.Herum" Date: Mon, 4 Nov 2024 07:22:26 +0100 Subject: [PATCH] Refactor date and time initialization logic. #deploy-oppdrag-service Changed the LOCAL_DATE and LOCAL_DATE_TIME initializations to use fixed values for consistency in tests. Reformatted DB2_DATE_TIME_FORMAT and adjusted its parsing mechanism accordingly. --- .../testnav/oppdragservice/utilty/Oppdragsdata.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/oppdrag-service/src/test/java/no/nav/testnav/oppdragservice/utilty/Oppdragsdata.java b/apps/oppdrag-service/src/test/java/no/nav/testnav/oppdragservice/utilty/Oppdragsdata.java index 1f21ff7d95..6defd582de 100644 --- a/apps/oppdrag-service/src/test/java/no/nav/testnav/oppdragservice/utilty/Oppdragsdata.java +++ b/apps/oppdrag-service/src/test/java/no/nav/testnav/oppdragservice/utilty/Oppdragsdata.java @@ -22,13 +22,13 @@ @UtilityClass public class Oppdragsdata { - public static final LocalDate LOCAL_DATE = LocalDate.now(); - public static final LocalDateTime LOCAL_DATE_TIME = LocalDateTime.now(); - + public static final LocalDate LOCAL_DATE = LocalDate.of(2024,11,4); public static final String TARGET_DATE_FORMAT = DateTimeFormatter .ofPattern("dd-MM-yyyy").format(LOCAL_DATE); - public static final String DB2_DATE_TIME_FORMAT = DateTimeFormatter - .ofPattern("yyyy-MM-dd-HH.mm.ss.SSSSSS").format(LOCAL_DATE_TIME); + + public static final String DB2_DATE_TIME_FORMAT = "2024-11-04-07.17.34.123456"; + public static final LocalDateTime LOCAL_DATE_TIME = LocalDateTime.from(DateTimeFormatter + .ofPattern("yyyy-MM-dd-HH.mm.ss.SSSSSS").parse(DB2_DATE_TIME_FORMAT)); public static final String TEXT_VALUE = "tekst"; public static final Integer NUMBER_VALUE = 123;