Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
nroduit committed Feb 16, 2024
1 parent 72cdf1d commit 7012fec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.41.1</version>
<version>2.43.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
15 changes: 11 additions & 4 deletions src/test/java/org/dcm4che3/img/util/DicomUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,22 @@
import java.time.ZoneOffset;
import java.time.format.DateTimeParseException;
import java.util.Date;
import java.util.Locale;
import org.dcm4che3.data.Attributes;
import org.dcm4che3.data.Tag;
import org.dcm4che3.data.VR;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

class DicomUtilsTest {

@BeforeAll
static void setUp() {
Locale.setDefault(Locale.US);
}

@Test
void testGetPeriod() {
assertEquals(
Expand Down Expand Up @@ -186,14 +193,14 @@ void testGetFormattedText() {
assertEquals("Value", DicomUtils.getFormattedText("Value", "$V"));
assertEquals("Value", DicomUtils.getFormattedText("Value", null));
assertEquals("Value", DicomUtils.getFormattedText("Value", ""));
assertEquals("1 janv. 1970", DicomUtils.getFormattedText(LocalDate.of(1970, 1, 1), "Format"));
assertEquals("Jan 1, 1970", DicomUtils.getFormattedText(LocalDate.of(1970, 1, 1), "Format"));
assertEquals(
"1 janv. 1970, 00:00:00",
"Jan 1, 1970, 12:00:00 AM",
DicomUtils.getFormattedText(LocalDate.of(1970, 1, 1).atStartOfDay(), "Format"));
assertEquals("00:00:00", DicomUtils.getFormattedText(LocalTime.MIDNIGHT, "Format"));
assertEquals("12:00:00 AM", DicomUtils.getFormattedText(LocalTime.MIDNIGHT, "Format"));
assertEquals("", DicomUtils.getFormattedText(DayOfWeek.MONDAY, "Format"));
assertEquals(
"1 janv. 1970, 00:00:00",
"Jan 1, 1970, 12:00:00 AM",
DicomUtils.getFormattedText(
LocalDate.of(1970, 1, 1).atStartOfDay().atZone(ZoneOffset.UTC), "Format"));
}
Expand Down

0 comments on commit 7012fec

Please sign in to comment.