diff options
Diffstat (limited to 'src/integrationTest/kotlin')
| -rw-r--r-- | src/integrationTest/kotlin/dev/dnpm/etl/processor/config/GPasConfigPropertiesTest.kt | 54 | ||||
| -rw-r--r-- | src/integrationTest/kotlin/dev/dnpm/etl/processor/pseudonym/GpasPseudonymGeneratorTest.kt | 3 |
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) } |
