summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorPaul-Christian Volkmer2026-03-05 04:15:40 +0100
committerGitHub2026-03-05 04:15:40 +0100
commit159ad72d0c16259e36878baa8ca64b4c4b0d6bf9 (patch)
treeecd7ba866c4ea4bc782df9d1a282585ce06ff9c6 /src/test
parent81c75221f7a8d2dcb827cf26ee4222b14b53030e (diff)
deps!: migrate to Spring Boot 4 (#250)
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/dev/dnpm/etl/processor/consent/GicsConsentServiceTest.java2
-rw-r--r--src/test/java/dev/dnpm/etl/processor/consent/GicsGetBroadConsentServiceTest.java2
-rw-r--r--src/test/kotlin/dev/dnpm/etl/processor/helpers.kt2
-rw-r--r--src/test/kotlin/dev/dnpm/etl/processor/output/KafkaMtbFileSenderTest.kt24
4 files changed, 21 insertions, 9 deletions
diff --git a/src/test/java/dev/dnpm/etl/processor/consent/GicsConsentServiceTest.java b/src/test/java/dev/dnpm/etl/processor/consent/GicsConsentServiceTest.java
index e450e4d..22f676b 100644
--- a/src/test/java/dev/dnpm/etl/processor/consent/GicsConsentServiceTest.java
+++ b/src/test/java/dev/dnpm/etl/processor/consent/GicsConsentServiceTest.java
@@ -26,7 +26,7 @@ import org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.autoconfigure.web.client.RestClientTest;
+import org.springframework.boot.restclient.test.autoconfigure.RestClientTest;
import org.springframework.http.MediaType;
import org.springframework.retry.support.RetryTemplate;
import org.springframework.test.context.ContextConfiguration;
diff --git a/src/test/java/dev/dnpm/etl/processor/consent/GicsGetBroadConsentServiceTest.java b/src/test/java/dev/dnpm/etl/processor/consent/GicsGetBroadConsentServiceTest.java
index cced1cf..46da158 100644
--- a/src/test/java/dev/dnpm/etl/processor/consent/GicsGetBroadConsentServiceTest.java
+++ b/src/test/java/dev/dnpm/etl/processor/consent/GicsGetBroadConsentServiceTest.java
@@ -21,7 +21,7 @@ import org.hl7.fhir.r4.model.OperationOutcome.OperationOutcomeIssueComponent;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.autoconfigure.web.client.RestClientTest;
+import org.springframework.boot.restclient.test.autoconfigure.RestClientTest;
import org.springframework.http.MediaType;
import org.springframework.retry.support.RetryTemplate;
import org.springframework.test.context.ContextConfiguration;
diff --git a/src/test/kotlin/dev/dnpm/etl/processor/helpers.kt b/src/test/kotlin/dev/dnpm/etl/processor/helpers.kt
index 495bf38..b7bf436 100644
--- a/src/test/kotlin/dev/dnpm/etl/processor/helpers.kt
+++ b/src/test/kotlin/dev/dnpm/etl/processor/helpers.kt
@@ -25,6 +25,6 @@ import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.ArgumentsProvider
open class ArgProvider(vararg val data: Arguments) : ArgumentsProvider {
- override fun provideArguments(context: ExtensionContext?): Stream<out Arguments> =
+ override fun provideArguments(context: ExtensionContext): Stream<out Arguments> =
Stream.of(*data)
}
diff --git a/src/test/kotlin/dev/dnpm/etl/processor/output/KafkaMtbFileSenderTest.kt b/src/test/kotlin/dev/dnpm/etl/processor/output/KafkaMtbFileSenderTest.kt
index 8adc21c..ac14366 100644
--- a/src/test/kotlin/dev/dnpm/etl/processor/output/KafkaMtbFileSenderTest.kt
+++ b/src/test/kotlin/dev/dnpm/etl/processor/output/KafkaMtbFileSenderTest.kt
@@ -31,6 +31,8 @@ import java.util.*
import java.util.concurrent.CompletableFuture.completedFuture
import java.util.concurrent.ExecutionException
import org.apache.kafka.clients.producer.ProducerRecord
+import org.apache.kafka.clients.producer.RecordMetadata
+import org.apache.kafka.common.TopicPartition
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Nested
@@ -77,7 +79,7 @@ class KafkaMtbFileSenderTest {
if (null != testData.exception) {
throw testData.exception
}
- completedFuture(SendResult<String, String>(null, null))
+ completedFuture(SendResult<String, String>(testProducerRecord(), testProducerRecordWithMetadata()))
}
.whenever(kafkaTemplate)
.send(any<ProducerRecord<String, String>>())
@@ -98,7 +100,7 @@ class KafkaMtbFileSenderTest {
if (null != testData.exception) {
throw testData.exception
}
- completedFuture(SendResult<String, String>(null, null))
+ completedFuture(SendResult<String, String>(testProducerRecord(), testProducerRecordWithMetadata()))
}
.whenever(kafkaTemplate)
.send(any<ProducerRecord<String, String>>())
@@ -145,7 +147,7 @@ class KafkaMtbFileSenderTest {
if (null != testData.exception) {
throw testData.exception
}
- completedFuture(SendResult<String, String>(null, null))
+ completedFuture(SendResult<String, String>(testProducerRecord(), testProducerRecordWithMetadata()))
}
.whenever(kafkaTemplate)
.send(any<ProducerRecord<String, String>>())
@@ -156,7 +158,7 @@ class KafkaMtbFileSenderTest {
@Test
fun shouldSendMtbFileRequestWithCorrectKeyAndHeaderAndBody() {
- doAnswer { completedFuture(SendResult<String, String>(null, null)) }
+ doAnswer { completedFuture(SendResult<String, String>(testProducerRecord(), testProducerRecordWithMetadata())) }
.whenever(kafkaTemplate)
.send(any<ProducerRecord<String, String>>())
@@ -182,7 +184,7 @@ class KafkaMtbFileSenderTest {
@Test
fun shouldSendDeleteRequestWithCorrectKeyAndHeaderAndBody() {
- doAnswer { completedFuture(SendResult<String, String>(null, null)) }
+ doAnswer { completedFuture(SendResult<String, String>(testProducerRecord(), testProducerRecordWithMetadata())) }
.whenever(kafkaTemplate)
.send(any<ProducerRecord<String, String>>())
@@ -216,7 +218,7 @@ class KafkaMtbFileSenderTest {
if (null != testData.exception) {
throw testData.exception
}
- completedFuture(SendResult<String, String>(null, null))
+ completedFuture(SendResult<String, String>(testProducerRecord(), testProducerRecordWithMetadata()))
}
.whenever(kafkaTemplate)
.send(any<ProducerRecord<String, String>>())
@@ -235,6 +237,16 @@ class KafkaMtbFileSenderTest {
}
}
+ fun testProducerRecord(): ProducerRecord<String, String> {
+ return ProducerRecord<String, String>("testtopic", "testkey", "testvalue")
+ }
+
+ fun testProducerRecordWithMetadata(): RecordMetadata {
+ return RecordMetadata(
+ TopicPartition("testtopic", 0), 0, 0, Instant.now().epochSecond, 0, 0
+ )
+ }
+
companion object {
val TEST_REQUEST_ID = RequestId("TestId")
val TEST_PATIENT_PSEUDONYM = PatientPseudonym("PID")