Skip to content

Commit

Permalink
[MODORDSTOR-356] - Increased coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Khamidulla Abdulkhakimov authored and Khamidulla Abdulkhakimov committed Nov 13, 2023
1 parent b211b99 commit c74b76f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/test/java/org/folio/rest/impl/PieceApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ void testPutPiecesByIdTest() throws Exception {
pieceRequest.put("receivingStatus", "Received");

addMockEntry(PIECES_STORAGE, pieceStorage);
verifyPut(String.format(PIECES_ID_PATH, pieceId), pieceRequest, "", 204);
verifyPut(String.format(PIECES_ID_PATH, pieceId), pieceRequest, "", 204)
.then()
.assertThat()
.body("statusUpdatedDate", notNullValue());;

// Message sent to event bus
HandlersTestHelper.verifyReceiptStatusUpdateEvent(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
import static org.folio.service.inventory.InventoryManager.HOLDING_PERMANENT_LOCATION_ID;
import static org.folio.service.inventory.InventoryManager.ITEM_STATUS;
import static org.folio.service.inventory.InventoryManager.ITEM_STATUS_NAME;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
Expand Down Expand Up @@ -235,7 +234,7 @@ void shouldUpdateLineQuantityIfPoLineIsNotPackageAndHoldingReferenceChangedAndSh
Piece pieceFromStorage = new Piece().withId(pieceId).withPoLineId(lineId).withItemId(itemId).withTitleId(titleId)
.withHoldingId(oldHoldingId).withFormat(Piece.Format.ELECTRONIC);
Piece incomingPieceToUpdate = new Piece().withId(pieceId).withPoLineId(lineId).withItemId(itemId).withTitleId(titleId)
.withHoldingId(holdingIdToUpdate).withFormat(Piece.Format.ELECTRONIC);
.withHoldingId(holdingIdToUpdate).withFormat(Piece.Format.ELECTRONIC).withReceivingStatus(Piece.ReceivingStatus.RECEIVED);
Cost cost = new Cost().withQuantityElectronic(1);
Location loc = new Location().withHoldingId(oldHoldingId).withQuantityElectronic(1).withQuantity(1);
PoLine poLine = new PoLine().withIsPackage(false).withPurchaseOrderId(orderId).withId(lineId)
Expand Down Expand Up @@ -265,6 +264,7 @@ void shouldUpdateLineQuantityIfPoLineIsNotPackageAndHoldingReferenceChangedAndSh
Piece pieceToUpdate = pieceToUpdateCapture.getValue();
PieceUpdateHolder pieceUpdateHolder = pieceUpdateHolderCapture.getValue();

assertNotNull(pieceToUpdate.getStatusUpdatedDate());
verify(basePieceFlowHolderBuilder).updateHolderWithOrderInformation(pieceUpdateHolderCapture.capture(), eq(requestContext));
verify(pieceUpdateFlowPoLineService).updatePoLine(pieceUpdateHolderCapture.capture(), eq(requestContext));
verify(pieceUpdateFlowInventoryManager).processInventory(any(PieceUpdateHolder.class), eq(requestContext));
Expand Down

0 comments on commit c74b76f

Please sign in to comment.