diff --git a/src/test/java/org/folio/circulationbff/api/CheckInApiTest.java b/src/test/java/org/folio/circulationbff/api/CheckInApiTest.java index 766196a..d6db7a1 100644 --- a/src/test/java/org/folio/circulationbff/api/CheckInApiTest.java +++ b/src/test/java/org/folio/circulationbff/api/CheckInApiTest.java @@ -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())