summaryrefslogtreecommitdiff
path: root/src/integrationTest/kotlin/dev/dnpm/etl
diff options
context:
space:
mode:
authorPaul-Christian Volkmer2025-11-06 16:02:29 +0100
committerGitHub2025-11-06 16:02:29 +0100
commit7f7304ebca5744edd8423e1486adcf77d623a745 (patch)
treea81dcc5024c67020cb50563b7e33d9f8922004cb /src/integrationTest/kotlin/dev/dnpm/etl
parentc4a5d8289ac21e5c0ba4d2bd20607a3e3951320b (diff)
fix: docs uses APP_PSEUDOMYMIZE_GPAS_PID_DOMAIN (#184)
Diffstat (limited to 'src/integrationTest/kotlin/dev/dnpm/etl')
-rw-r--r--src/integrationTest/kotlin/dev/dnpm/etl/processor/config/GPasConfigPropertiesTest.kt54
-rw-r--r--src/integrationTest/kotlin/dev/dnpm/etl/processor/pseudonym/GpasPseudonymGeneratorTest.kt3
2 files changed, 56 insertions, 1 deletions
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)
}