summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul-Christian Volkmer2026-05-26 10:10:34 +0200
committerGitHub2026-05-26 08:10:34 +0000
commita66c4959f4f651f5e92473f3f346ff50bd6fb7ff (patch)
tree51c22dd56c88bed8dda8fc19fde1f44861a06f9c /src
parenta26c11026fbca0dd12a91779806badd889a6ee57 (diff)
fix: update Jackson config to fix probably bean dependency issue (#291)
In rare cases, the dependency to the Jackson 3 config was not present as unique dependency when starting the application.
Diffstat (limited to 'src')
-rw-r--r--src/integrationTest/kotlin/dev/dnpm/etl/processor/output/RestDipMtbFileSenderTest.kt12
-rw-r--r--src/main/kotlin/dev/dnpm/etl/processor/config/AppConfiguration.kt13
2 files changed, 10 insertions, 15 deletions
diff --git a/src/integrationTest/kotlin/dev/dnpm/etl/processor/output/RestDipMtbFileSenderTest.kt b/src/integrationTest/kotlin/dev/dnpm/etl/processor/output/RestDipMtbFileSenderTest.kt
index bb24ea0..9c94c4a 100644
--- a/src/integrationTest/kotlin/dev/dnpm/etl/processor/output/RestDipMtbFileSenderTest.kt
+++ b/src/integrationTest/kotlin/dev/dnpm/etl/processor/output/RestDipMtbFileSenderTest.kt
@@ -21,11 +21,7 @@
package dev.dnpm.etl.processor.output
import dev.dnpm.etl.processor.RequestId
-import dev.dnpm.etl.processor.config.AppConfiguration
-import dev.dnpm.etl.processor.config.AppRestConfiguration
-import dev.dnpm.etl.processor.config.AppSecurityConfiguration
-import dev.dnpm.etl.processor.config.JacksonConfig
-import dev.dnpm.etl.processor.config.RestTargetProperties
+import dev.dnpm.etl.processor.config.*
import dev.dnpm.etl.processor.consent.ConsentEvaluator
import dev.dnpm.etl.processor.monitoring.ReportService
import dev.dnpm.etl.processor.monitoring.RequestStatus
@@ -64,6 +60,7 @@ import java.util.*
AppSecurityConfiguration::class,
AppRestConfiguration::class,
ConsentEvaluator::class,
+ JacksonConfig::class,
],
)
@TestPropertySource(
@@ -80,8 +77,11 @@ class RestDipMtbFileSenderTest {
private var reportService =
ReportService(JsonMapper.builder().addModule(KotlinModule.Builder().build()).build())
+
@BeforeEach
- fun setup(@Autowired restTemplate: RestTemplate) {
+ fun setup(
+ @Autowired restTemplate: RestTemplate
+ ) {
val restTemplate = restTemplate
val restTargetProperties = RestTargetProperties("http://localhost:9000/api", null, null)
val retryTemplate = RetryTemplateBuilder().customPolicy(SimpleRetryPolicy(1)).build()
diff --git a/src/main/kotlin/dev/dnpm/etl/processor/config/AppConfiguration.kt b/src/main/kotlin/dev/dnpm/etl/processor/config/AppConfiguration.kt
index 1c18aab..3e88ffd 100644
--- a/src/main/kotlin/dev/dnpm/etl/processor/config/AppConfiguration.kt
+++ b/src/main/kotlin/dev/dnpm/etl/processor/config/AppConfiguration.kt
@@ -170,20 +170,15 @@ class AppConfiguration {
}
@Bean
- fun reportService(): ReportService {
- return ReportService(getJsonMapper())
+ fun reportService(jsonMapper: JsonMapper): ReportService {
+ return ReportService(jsonMapper)
}
@Bean
- fun getJsonMapper(): JsonMapper {
- return JacksonConfig().jsonMapper()
- }
-
- @Bean
- fun transformationService(configProperties: AppConfigProperties): TransformationService {
+ fun transformationService(jsonMapper: JsonMapper, configProperties: AppConfigProperties): TransformationService {
logger.info("Apply ${configProperties.transformations.size} transformation rules")
return TransformationService(
- getJsonMapper(),
+ jsonMapper,
configProperties.transformations.map { Transformation.of(it.path) from it.from to it.to },
)
}