Skip to content

Commit

Permalink
Fix locale for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nroduit committed Jul 26, 2024
1 parent a6debdc commit ca8fab9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,16 @@
@TestInstance(
TestInstance.Lifecycle.PER_CLASS) // To enable BeforeAll and AfterAll for Locale.setDefault()
class DicomUtilsTest {
static final Locale defaultLocale = Locale.getDefault();
private Locale defaultLocale;

@BeforeAll
static void setUp() {
void setUp() {
defaultLocale = Locale.getDefault();
Locale.setDefault(Locale.US); // Force Locale for testing date format
}

@AfterAll
static void tearDown() {
void tearDown() {
Locale.setDefault(defaultLocale);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@
@TestInstance(
TestInstance.Lifecycle.PER_CLASS) // To enable BeforeAll and AfterAll for Locale.setDefault()
class AnatomicBuilderTest {
static final Locale defaultLocale = Locale.getDefault();
private Locale defaultLocale;

@BeforeAll
static void setUp() {
void setUp() {
defaultLocale = Locale.getDefault();
Locale.setDefault(Locale.FRENCH); // Force Locale for testing translation
}

@AfterAll
static void tearDown() {
void tearDown() {
Locale.setDefault(defaultLocale);
}

Expand Down

0 comments on commit ca8fab9

Please sign in to comment.