Skip to content

Commit

Permalink
MODTLR-98 Extend integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
OleksandrVidinieiev committed Dec 9, 2024
1 parent 795db04 commit 1dbf866
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/test/java/org/folio/api/EcsTlrApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1dbf866

Please sign in to comment.