From 7f7304ebca5744edd8423e1486adcf77d623a745 Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Thu, 6 Nov 2025 16:02:29 +0100 Subject: fix: docs uses APP_PSEUDOMYMIZE_GPAS_PID_DOMAIN (#184) --- .../processor/config/GPasConfigPropertiesTest.kt | 54 ++++++++++++++++++++++ .../pseudonym/GpasPseudonymGeneratorTest.kt | 3 +- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 src/integrationTest/kotlin/dev/dnpm/etl/processor/config/GPasConfigPropertiesTest.kt (limited to 'src/integrationTest/kotlin/dev/dnpm/etl') diff --git a/src/integrationTest/kotlin/dev/dnpm/etl/processor/config/GPasConfigPropertiesTest.kt b/src/integrationTest/kotlin/dev/dnpm/etl/processor/config/GPasConfigPropertiesTest.kt new file mode 100644 index 0000000..66e0660 --- /dev/null +++ b/src/integrationTest/kotlin/dev/dnpm/etl/processor/config/GPasConfigPropertiesTest.kt @@ -0,0 +1,54 @@ +package dev.dnpm.etl.processor.config + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test +import org.springframework.boot.context.properties.EnableConfigurationProperties +import org.springframework.boot.test.context.SpringBootTest +import org.springframework.boot.test.context.runner.ApplicationContextRunner +import org.springframework.test.context.ContextConfiguration + + +@SpringBootTest +@ContextConfiguration( + classes = [ + GPasConfigProperties::class, + ] +) +class GPasConfigPropertiesTest { + + @EnableConfigurationProperties(GPasConfigProperties::class) + class TestConfig {} + + @Test + fun shouldUseConfiguredPatientDomainIfPidDomainGiven() { + ApplicationContextRunner() + .withUserConfiguration(TestConfig::class.java) + .withPropertyValues( + "app.pseudonymize.gpas.uri=http://localhost/", + "app.pseudonymize.gpas.pid-domain=test-pid-domain" + ) + .run { context -> + val properties = context.getBean(GPasConfigProperties::class.java) + + assertThat(properties).isNotNull + assertThat(properties.patientDomain).isEqualTo("test-pid-domain") + } + } + + @Test + fun shouldUseConfiguredPatientDomain() { + ApplicationContextRunner() + .withUserConfiguration(TestConfig::class.java) + .withPropertyValues( + "app.pseudonymize.gpas.uri=http://localhost/", + "app.pseudonymize.gpas.patient-domain=test-patient-domain" + ) + .run { context -> + val properties = context.getBean(GPasConfigProperties::class.java) + + assertThat(properties).isNotNull + assertThat(properties.patientDomain).isEqualTo("test-patient-domain") + } + } + +} \ No newline at end of file diff --git a/src/integrationTest/kotlin/dev/dnpm/etl/processor/pseudonym/GpasPseudonymGeneratorTest.kt b/src/integrationTest/kotlin/dev/dnpm/etl/processor/pseudonym/GpasPseudonymGeneratorTest.kt index 1bf443e..578810e 100644 --- a/src/integrationTest/kotlin/dev/dnpm/etl/processor/pseudonym/GpasPseudonymGeneratorTest.kt +++ b/src/integrationTest/kotlin/dev/dnpm/etl/processor/pseudonym/GpasPseudonymGeneratorTest.kt @@ -53,6 +53,7 @@ class GpasPseudonymGeneratorTest { val gPasConfigProperties = GPasConfigProperties( CONFIGURED_URI, null, + null, "test", "test2", null, null @@ -104,7 +105,7 @@ class GpasPseudonymGeneratorTest { withStatus(HttpStatus.FOUND) .header( HttpHeaders.LOCATION, - "https://localhost/ttp-fhir/fhir/gpas/\$pseudonymizeAllowCreate" + $$"https://localhost/ttp-fhir/fhir/gpas/$pseudonymizeAllowCreate" ) .createResponse(it) } -- cgit v1.2.3