Skip to content

Commit

Permalink
MCBFF-38: increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
imerabishvili committed Jan 23, 2025
1 parent 206ec02 commit f662700
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/java/org/folio/circulationbff/api/CheckInApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,26 @@ private void givenCirculationCheckinSucceed(CheckInRequest request) {
.willReturn(jsonResponse(checkinResponse, SC_OK)));
}

@Test
@SneakyThrows
void checkInSuccessWhenInstanceNotFound() {
// given
var request = new CheckInRequest()
.itemBarcode("test_barcode")
.checkInDate(new Date())
.servicePointId(randomUUID());

givenCirculationCheckinSucceed(request);

var searchResponse = new SearchInstances().instances(List.of());
wireMockServer.stubFor(WireMock.get(urlMatching("/search/instances.*"))
.willReturn(jsonResponse(searchResponse, SC_OK)));

// when-then
checkIn(request)
.andExpect(status().isOk());
}

private void givenSearchInstanceReturnsItem(String tenantId, Item item) {
var searchItem = new SearchItem()
.id(item.getId())
Expand Down

0 comments on commit f662700

Please sign in to comment.