From f3339cb05159b96c23cc054008f1093a55575e5e Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 16 Aug 2024 11:34:21 +0200 Subject: [PATCH] Fix test depending on default time zone --- .../examples/annotation/AnnotationExamples.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/test/java/com/univocity/parsers/examples/annotation/AnnotationExamples.java b/src/test/java/com/univocity/parsers/examples/annotation/AnnotationExamples.java index 45a4b455..f0b4dcd5 100644 --- a/src/test/java/com/univocity/parsers/examples/annotation/AnnotationExamples.java +++ b/src/test/java/com/univocity/parsers/examples/annotation/AnnotationExamples.java @@ -21,6 +21,7 @@ import org.testng.annotations.*; import java.io.*; +import java.util.TimeZone; public class AnnotationExamples extends Example { @@ -178,6 +179,19 @@ public void parseAddressBook(){ printAndValidate(); } + TimeZone timeZone; + + @BeforeClass + void setTimeZone() { + timeZone = TimeZone.getDefault(); + TimeZone.setDefault(TimeZone.getTimeZone("Australia/Adelaide")); + } + + @AfterClass + void resetTimeZone() { + TimeZone.setDefault(timeZone); + } + @Test public void parseDates(){ Reader input;