Skip to content

Commit

Permalink
Merge pull request #254 from GuillaumeTaffin/fix-locale-dependent-tests
Browse files Browse the repository at this point in the history
Fix the locale used by SimpleDateFormat objects to Locale.US.
  • Loading branch information
simonbrowndotje authored Feb 24, 2024
2 parents 1cffac0 + b553db4 commit d32faa9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.TimeZone;
import java.util.Locale;

import static org.junit.jupiter.api.Assertions.*;

Expand Down Expand Up @@ -81,7 +81,7 @@ public void test_importDecisions() {
Decision decision1 = documentation.getDecisions().stream().filter(d -> d.getId().equals("1")).findFirst().get();
assertEquals("1", decision1.getId());
assertEquals("Record architecture decisions", decision1.getTitle());
SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy");
SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy", Locale.US);
assertEquals("12-Feb-2016", sdf.format(decision1.getDate()));
assertEquals("Accepted", decision1.getStatus());
Assertions.assertEquals(Format.Markdown, decision1.getFormat());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.TimeZone;
import java.util.Locale;

import static org.junit.jupiter.api.Assertions.*;

Expand Down Expand Up @@ -75,7 +75,7 @@ public void test_importDocumentation_ThrowsAnException_WhenAPathIsSpecifiedButIt
@Test
public void test_importDecisions() {
decisionImporter.importDocumentation(workspace, DECISIONS_FOLDER);
SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy");
SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy", Locale.US);

assertEquals(4, documentation.getDecisions().size());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.TimeZone;
import java.util.Locale;

import static org.junit.jupiter.api.Assertions.*;

Expand Down Expand Up @@ -75,7 +75,7 @@ public void test_importDocumentation_ThrowsAnException_WhenAPathIsSpecifiedButIt
@Test
public void test_importDecisions() {
decisionImporter.importDocumentation(workspace, DECISIONS_FOLDER);
SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy");
SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy", Locale.US);

assertEquals(19, documentation.getDecisions().size());

Expand Down

0 comments on commit d32faa9

Please sign in to comment.