1
0
mirror of https://github.com/pcvolkmer/etl-processor.git synced 2025-04-20 17:56:50 +00:00

test: add pseudonymize generator property and default to tests

This commit is contained in:
Paul-Christian Volkmer 2024-01-12 19:59:01 +01:00
parent 7ac151202a
commit 113bf2dd2e
3 changed files with 5 additions and 2 deletions

View File

@ -48,7 +48,8 @@ import org.testcontainers.junit.jupiter.Testcontainers
@MockBean(MtbFileSender::class) @MockBean(MtbFileSender::class)
@TestPropertySource( @TestPropertySource(
properties = [ properties = [
"app.rest.uri=http://example.com" "app.rest.uri=http://example.com",
"app.pseudonymize.generator=buildin"
] ]
) )
class EtlProcessorApplicationTests : AbstractTestcontainerTest() { class EtlProcessorApplicationTests : AbstractTestcontainerTest() {
@ -64,6 +65,7 @@ class EtlProcessorApplicationTests : AbstractTestcontainerTest() {
@AutoConfigureMockMvc @AutoConfigureMockMvc
@TestPropertySource( @TestPropertySource(
properties = [ properties = [
"app.pseudonymize.generator=buildin",
"app.transformations[0].path=diagnoses[*].icd10.version", "app.transformations[0].path=diagnoses[*].icd10.version",
"app.transformations[0].from=2013", "app.transformations[0].from=2013",
"app.transformations[0].to=2014", "app.transformations[0].to=2014",

View File

@ -46,6 +46,7 @@ import java.util.*
@MockBean(MtbFileSender::class) @MockBean(MtbFileSender::class)
@TestPropertySource( @TestPropertySource(
properties = [ properties = [
"app.pseudonymize.generator=buildin",
"app.rest.uri=http://example.com" "app.rest.uri=http://example.com"
] ]
) )

View File

@ -61,7 +61,7 @@ class AppConfiguration {
return GpasPseudonymGenerator(configProperties) return GpasPseudonymGenerator(configProperties)
} }
@ConditionalOnProperty(value = ["app.pseudonymize.generator"], havingValue = "BUILDIN") @ConditionalOnProperty(value = ["app.pseudonymize.generator"], havingValue = "BUILDIN", matchIfMissing = true)
@Bean @Bean
fun buildinPseudonymGenerator(): Generator { fun buildinPseudonymGenerator(): Generator {
return AnonymizingGenerator() return AnonymizingGenerator()