Skip to content

Commit

Permalink
Fix test depending on default time zone
Browse files Browse the repository at this point in the history
  • Loading branch information
marcphilipp committed Aug 16, 2024
1 parent e42a22b commit f3339cb
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.testng.annotations.*;

import java.io.*;
import java.util.TimeZone;

public class AnnotationExamples extends Example {

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f3339cb

Please sign in to comment.