From 1dbf8666bb8a96deaf271ab928bdf87774c451d0 Mon Sep 17 00:00:00 2001 From: Oleksandr Vidinieiev Date: Mon, 9 Dec 2024 18:07:36 +0200 Subject: [PATCH] MODTLR-98 Extend integration test --- src/test/java/org/folio/api/EcsTlrApiTest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/folio/api/EcsTlrApiTest.java b/src/test/java/org/folio/api/EcsTlrApiTest.java index 29abcb6..29bc46c 100644 --- a/src/test/java/org/folio/api/EcsTlrApiTest.java +++ b/src/test/java/org/folio/api/EcsTlrApiTest.java @@ -349,13 +349,17 @@ void ecsTlrIsCreated(RequestTypeEnum requestType, boolean requesterClonesExist, .withHeader(HEADER_TENANT, equalTo(TENANT_ID_COLLEGE))); wireMockServer.verify(postRequestedFor(urlMatching(REQUESTS_URL)) - .withHeader(HEADER_TENANT, equalTo(TENANT_ID_COLLEGE)) // because this tenant has available item + .withHeader(HEADER_TENANT, equalTo(TENANT_ID_COLLEGE)) .withRequestBody(equalToJson(asJsonString(secondaryRequestPostRequest)))); wireMockServer.verify(postRequestedFor(urlMatching(REQUESTS_URL)) .withHeader(HEADER_TENANT, equalTo(TENANT_ID_CONSORTIUM)) .withRequestBody(equalToJson(asJsonString(intermediateRequestPostRequest)))); + wireMockServer.verify(postRequestedFor(urlMatching(REQUESTS_URL)) + .withHeader(HEADER_TENANT, equalTo(TENANT_ID_UNIVERSITY)) + .withRequestBody(equalToJson(asJsonString(primaryRequestPostRequest)))); + if (requesterClonesExist) { wireMockServer.verify(exactly(0), postRequestedFor(urlMatching(USERS_URL))); wireMockServer.verify(exactly(2), putRequestedFor(urlMatching(USERS_URL + "/" + REQUESTER_ID))); @@ -383,6 +387,10 @@ void ecsTlrIsCreated(RequestTypeEnum requestType, boolean requesterClonesExist, wireMockServer.verify(postRequestedFor(urlMatching(POST_ECS_REQUEST_TRANSACTION_URL_PATTERN)) .withHeader(HEADER_TENANT, equalTo(TENANT_ID_COLLEGE)) .withRequestBody(equalToJson(asJsonString(lenderTransactionPostRequest)))); + + wireMockServer.verify(postRequestedFor(urlMatching(POST_ECS_REQUEST_TRANSACTION_URL_PATTERN)) + .withHeader(HEADER_TENANT, equalTo(TENANT_ID_UNIVERSITY)) + .withRequestBody(equalToJson(asJsonString(pickupTransactionPostRequest)))); } @Test