diff --git a/src/test/java/org/miracum/streams/ume/obdstofhir/mapper/mii/ConditionMapperTest.java b/src/test/java/org/miracum/streams/ume/obdstofhir/mapper/mii/ConditionMapperTest.java index 91225903..fa3d49c6 100644 --- a/src/test/java/org/miracum/streams/ume/obdstofhir/mapper/mii/ConditionMapperTest.java +++ b/src/test/java/org/miracum/streams/ume/obdstofhir/mapper/mii/ConditionMapperTest.java @@ -8,14 +8,11 @@ import com.fasterxml.jackson.module.jakarta.xmlbind.JakartaXmlBindAnnotationModule; import de.basisdatensatz.obds.v3.OBDS; import java.io.IOException; -import java.text.SimpleDateFormat; import java.util.TimeZone; import org.approvaltests.Approvals; import org.approvaltests.core.Options; import org.hl7.fhir.r4.model.Reference; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; +import org.junit.jupiter.api.Test; import org.miracum.streams.ume.obdstofhir.FhirProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -24,25 +21,23 @@ @SpringBootTest(classes = {FhirProperties.class}) @EnableConfigurationProperties class ConditionMapperTest { + private final ConditionMapper sut; - private static ConditionMapper sut; - - @BeforeAll - static void beforeEach(@Autowired FhirProperties fhirProps) { - TimeZone.setDefault(TimeZone.getTimeZone("Europe/Berlin")); + @Autowired + ConditionMapperTest(FhirProperties fhirProps) { sut = new ConditionMapper(fhirProps); } - @ParameterizedTest - @CsvSource({"obds3/test1.xml"}) - void map_withGivenObds_shouldCreateValidConditionResource(String sourceFile) throws IOException { - final var resource = this.getClass().getClassLoader().getResource(sourceFile); + @Test + void map_withGivenObds_shouldCreateValidConditionResource() throws IOException { + TimeZone.setDefault(TimeZone.getTimeZone("Europe/Berlin")); + // TODO: refactor to use a data provider for parameterized tests + final var resource = this.getClass().getClassLoader().getResource("obds3/test1.xml"); assertThat(resource).isNotNull(); final var xmlMapper = XmlMapper.builder() .defaultUseWrapper(false) - .defaultDateFormat(new SimpleDateFormat("yyyy-MM-dd")) .addModule(new JakartaXmlBindAnnotationModule()) .addModule(new Jdk8Module()) .build(); diff --git a/src/test/java/snapshots/org/miracum/streams/ume/obdstofhir/mapper/mii/ConditionMapperTest.map_withGivenObds_shouldCreateValidConditionResource.approved.fhir.json b/src/test/java/snapshots/org/miracum/streams/ume/obdstofhir/mapper/mii/ConditionMapperTest.map_withGivenObds_shouldCreateValidConditionResource.approved.fhir.json index e024e129..79c40a54 100644 --- a/src/test/java/snapshots/org/miracum/streams/ume/obdstofhir/mapper/mii/ConditionMapperTest.map_withGivenObds_shouldCreateValidConditionResource.approved.fhir.json +++ b/src/test/java/snapshots/org/miracum/streams/ume/obdstofhir/mapper/mii/ConditionMapperTest.map_withGivenObds_shouldCreateValidConditionResource.approved.fhir.json @@ -12,5 +12,5 @@ "subject": { "reference": "Patient/1" }, - "recordedDate": "2024-06-10T00:00:00+02:00" + "recordedDate": "2024-06-10T02:00:00+02:00" }