summaryrefslogtreecommitdiff
path: root/src/main/kotlin/dev/dnpm/etl/processor
diff options
context:
space:
mode:
authorPaul-Christian Volkmer2026-05-06 10:12:38 +0200
committerPaul-Christian Volkmer2026-05-06 10:12:38 +0200
commit18640103831e1dc2d21bc0c3c91263ddf3f8503c (patch)
tree8aea99aa22ce9655aba59e3b4908ce808e4d993a /src/main/kotlin/dev/dnpm/etl/processor
parent615115dad8fb260bea6ea3436c1d239777b42df1 (diff)
test: code cleanup in test classes
Diffstat (limited to 'src/main/kotlin/dev/dnpm/etl/processor')
-rw-r--r--src/main/kotlin/dev/dnpm/etl/processor/monitoring/ConnectionCheckService.kt9
-rw-r--r--src/main/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSender.kt3
2 files changed, 7 insertions, 5 deletions
diff --git a/src/main/kotlin/dev/dnpm/etl/processor/monitoring/ConnectionCheckService.kt b/src/main/kotlin/dev/dnpm/etl/processor/monitoring/ConnectionCheckService.kt
index 085d0a3..a88cf10 100644
--- a/src/main/kotlin/dev/dnpm/etl/processor/monitoring/ConnectionCheckService.kt
+++ b/src/main/kotlin/dev/dnpm/etl/processor/monitoring/ConnectionCheckService.kt
@@ -33,6 +33,8 @@ import org.springframework.beans.factory.annotation.Qualifier
import org.springframework.http.*
import org.springframework.scheduling.annotation.Scheduled
import org.springframework.web.client.RestTemplate
+import org.springframework.web.client.exchange
+import org.springframework.web.client.getForEntity
import org.springframework.web.util.UriComponentsBuilder
import reactor.core.publisher.Sinks
@@ -139,13 +141,12 @@ class RestConnectionCheckService(
try {
val statusCode =
restTemplate
- .getForEntity(
+ .getForEntity<String>(
UriComponentsBuilder.fromUriString(restTargetProperties.uri.toString())
.pathSegment("mtb")
.pathSegment("kaplan-meier")
.pathSegment("config")
.toUriString(),
- String::class.java,
)
.statusCode
val available = statusCode == HttpStatus.OK
@@ -215,7 +216,7 @@ class GPasConnectionCheckService(
val statusCode =
restTemplate
- .exchange(uri, HttpMethod.GET, HttpEntity<Void>(headers), Void::class.java)
+ .exchange<Void>(uri, HttpMethod.GET, HttpEntity<Void>(headers))
.statusCode
val available = statusCode == HttpStatus.OK
@@ -285,7 +286,7 @@ class GIcsConnectionCheckService(
val statusCode =
restTemplate
- .exchange(uri, HttpMethod.GET, HttpEntity<Void>(headers), Void::class.java)
+ .exchange<Void>(uri, HttpMethod.GET, HttpEntity<Void>(headers))
.statusCode
val available = statusCode == HttpStatus.OK
diff --git a/src/main/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSender.kt b/src/main/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSender.kt
index a2a88b6..0d8ed7b 100644
--- a/src/main/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSender.kt
+++ b/src/main/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSender.kt
@@ -35,6 +35,7 @@ import org.springframework.retry.support.RetryTemplate
import org.springframework.web.client.RestClientException
import org.springframework.web.client.RestClientResponseException
import org.springframework.web.client.RestTemplate
+import org.springframework.web.client.exchange
abstract class RestMtbFileSender(
private val restTemplate: RestTemplate,
@@ -54,7 +55,7 @@ abstract class RestMtbFileSender(
val headers = getHttpHeaders(request)
val entityReq = HttpEntity(request.content, headers)
val response =
- restTemplate.exchange(sendUrl(), HttpMethod.POST, entityReq, String::class.java)
+ restTemplate.exchange<String>(sendUrl(), HttpMethod.POST, entityReq)
if (!response.statusCode.is2xxSuccessful) {
logger.warn("Error sending to remote system: {}", response.body)
return@execute MtbFileSender.Response(