summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorPaul-Christian Volkmer2025-02-09 11:19:35 +0100
committerPaul-Christian Volkmer2025-02-09 11:19:35 +0100
commit1e652a7856c0e658e4fdd0941879fd3959aad26b (patch)
treed1065eded89783b8310dfea42c1ff1ee787dc766 /src/test
parent74ff9f08a4e73243600e61e4176fc1e8f190c329 (diff)
test: explicit request URI check and fix use of expect()
Diffstat (limited to 'src/test')
-rw-r--r--src/test/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSenderTest.kt48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/test/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSenderTest.kt b/src/test/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSenderTest.kt
index 9b6332a..8a12186 100644
--- a/src/test/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSenderTest.kt
+++ b/src/test/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSenderTest.kt
@@ -59,12 +59,12 @@ class RestMtbFileSenderTest {
@ParameterizedTest
@MethodSource("deleteRequestWithResponseSource")
fun shouldReturnExpectedResponseForDelete(requestWithResponse: RequestWithResponse) {
- this.mockRestServiceServer.expect {
- method(HttpMethod.DELETE)
- requestTo("/mtbfile")
- }.andRespond {
- withStatus(requestWithResponse.httpStatus).body(requestWithResponse.body).createResponse(it)
- }
+ this.mockRestServiceServer
+ .expect(method(HttpMethod.DELETE))
+ .andExpect(requestTo("http://localhost:9000/mtbfile/Patient/$TEST_PATIENT_PSEUDONYM"))
+ .andRespond {
+ withStatus(requestWithResponse.httpStatus).body(requestWithResponse.body).createResponse(it)
+ }
val response = restMtbFileSender.send(MtbFileSender.DeleteRequest(TEST_REQUEST_ID, TEST_PATIENT_PSEUDONYM))
assertThat(response.status).isEqualTo(requestWithResponse.response.status)
@@ -74,12 +74,12 @@ class RestMtbFileSenderTest {
@ParameterizedTest
@MethodSource("mtbFileRequestWithResponseSource")
fun shouldReturnExpectedResponseForMtbFilePost(requestWithResponse: RequestWithResponse) {
- this.mockRestServiceServer.expect {
- method(HttpMethod.POST)
- requestTo("/mtbfile")
- }.andRespond {
- withStatus(requestWithResponse.httpStatus).body(requestWithResponse.body).createResponse(it)
- }
+ this.mockRestServiceServer
+ .expect(method(HttpMethod.POST))
+ .andExpect(requestTo("http://localhost:9000/mtbfile/MTBFile"))
+ .andRespond {
+ withStatus(requestWithResponse.httpStatus).body(requestWithResponse.body).createResponse(it)
+ }
val response = restMtbFileSender.send(MtbFileSender.MtbFileRequest(TEST_REQUEST_ID, mtbFile))
assertThat(response.status).isEqualTo(requestWithResponse.response.status)
@@ -103,12 +103,12 @@ class RestMtbFileSenderTest {
else -> ExpectedCount.max(3)
}
- this.mockRestServiceServer.expect(expectedCount) {
- method(HttpMethod.POST)
- requestTo("/mtbfile")
- }.andRespond {
- withStatus(requestWithResponse.httpStatus).body(requestWithResponse.body).createResponse(it)
- }
+ this.mockRestServiceServer
+ .expect(expectedCount, method(HttpMethod.POST))
+ .andExpect(requestTo("http://localhost:9000/mtbfile/MTBFile"))
+ .andRespond {
+ withStatus(requestWithResponse.httpStatus).body(requestWithResponse.body).createResponse(it)
+ }
val response = restMtbFileSender.send(MtbFileSender.MtbFileRequest(TEST_REQUEST_ID, mtbFile))
assertThat(response.status).isEqualTo(requestWithResponse.response.status)
@@ -132,12 +132,12 @@ class RestMtbFileSenderTest {
else -> ExpectedCount.max(3)
}
- this.mockRestServiceServer.expect(expectedCount) {
- method(HttpMethod.DELETE)
- requestTo("/mtbfile")
- }.andRespond {
- withStatus(requestWithResponse.httpStatus).body(requestWithResponse.body).createResponse(it)
- }
+ this.mockRestServiceServer
+ .expect(expectedCount, method(HttpMethod.DELETE))
+ .andExpect(requestTo("http://localhost:9000/mtbfile/Patient/$TEST_PATIENT_PSEUDONYM"))
+ .andRespond {
+ withStatus(requestWithResponse.httpStatus).body(requestWithResponse.body).createResponse(it)
+ }
val response = restMtbFileSender.send(MtbFileSender.DeleteRequest(TEST_REQUEST_ID, TEST_PATIENT_PSEUDONYM))
assertThat(response.status).isEqualTo(requestWithResponse.response.status)