Skip to content

Commit

Permalink
[MODORDERS-1209]. Remove piece from mockData piece collections
Browse files Browse the repository at this point in the history
  • Loading branch information
BKadirkhodjaev committed Dec 4, 2024
1 parent 0a94a74 commit 624315b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
8 changes: 7 additions & 1 deletion src/test/java/org/folio/rest/impl/ClaimingApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

import java.io.IOException;
import java.util.Objects;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
Expand All @@ -35,11 +36,14 @@
import static org.folio.TestConstants.ORDERS_CLAIMING_ENDPOINT;
import static org.folio.TestUtils.getMinimalOrder;
import static org.folio.TestUtils.getMockAsJson;
import static org.folio.TestUtils.getMockData;
import static org.folio.orders.utils.ResourcePathResolver.ORGANIZATION_STORAGE;
import static org.folio.orders.utils.ResourcePathResolver.PIECES_STORAGE;
import static org.folio.orders.utils.ResourcePathResolver.PO_LINES_STORAGE;
import static org.folio.orders.utils.ResourcePathResolver.PURCHASE_ORDER_STORAGE;
import static org.folio.rest.impl.MockServer.BASE_MOCK_DATA_PATH;
import static org.folio.rest.impl.MockServer.ORGANIZATION_COLLECTION;
import static org.folio.rest.impl.MockServer.PIECE_RECORDS_MOCK_DATA_PATH;
import static org.folio.rest.impl.MockServer.PO_LINES_COLLECTION;
import static org.folio.rest.impl.MockServer.addMockEntry;
import static org.folio.rest.impl.MockServer.getDataExportSpringJobCreations;
Expand Down Expand Up @@ -124,7 +128,7 @@ public MockHitDto(int pieceSearches, int polSearches, int purchaseOrderRetrieval
@ParameterizedTest
@MethodSource("testPostOrdersClaimArgs")
void testPostOrdersClaim(String name, int vendorIdx, int polIdx, int pieceIdx, MockHitDto dto,
String payloadFile, Header header, ClaimingPieceResult.Status expectedStatus) throws InterruptedException {
String payloadFile, Header header, ClaimingPieceResult.Status expectedStatus) throws InterruptedException, IOException {
logger.info("Testing postOrdersClaim, name: {}", name);

var organization = getMockAsJson(ORGANIZATION_COLLECTION)
Expand All @@ -136,10 +140,12 @@ void testPostOrdersClaim(String name, int vendorIdx, int polIdx, int pieceIdx, M
.mapTo(CompositePoLine.class);
var purchaseOrder = getMinimalOrder(poLine)
.withVendor(organization.getId());
var piece = new JsonObject(getMockData(PIECE_RECORDS_MOCK_DATA_PATH + "pieceRecord-dcd0ba36-b660-4751-b9fe-c8ac61ff6f99.json"));

addMockEntry(ORGANIZATION_STORAGE, organization);
addMockEntry(PURCHASE_ORDER_STORAGE, purchaseOrder);
addMockEntry(PO_LINES_STORAGE, poLine);
addMockEntry(PIECES_STORAGE, piece);

var headers = prepareHeaders(header);
var mockDataPath = BASE_MOCK_DATA_PATH + CLAIMING_MOCK_DATA_FOLDER + payloadFile;
Expand Down
13 changes: 0 additions & 13 deletions src/test/resources/mockdata/pieces/pieceRecordsCollection.json
Original file line number Diff line number Diff line change
Expand Up @@ -623,19 +623,6 @@
"displayOnHolding": true,
"discoverySuppress": false,
"statusUpdatedDate": "2024-09-06T13:33:34.267+00:00"
},
{
"id": "dcd0ba36-b660-4751-b9fe-c8ac61ff6f99",
"format": "Physical",
"itemId": "c43e0be8-e12e-4bed-81ba-58031bcd832e",
"isBound": false,
"titleId": "5f525419-da33-4731-9a19-0c59a371336f",
"poLineId": "428c60e8-c43d-4543-b0d4-36dada430e51",
"holdingId": "f845d96f-5d1d-4757-81a8-2066f233836a",
"displayToPublic": false,
"receivingStatus": "Late",
"displayOnHolding": false,
"statusUpdatedDate": "2024-11-28T11:28:52.523+00:00"
}
],
"totalRecords": 70
Expand Down

0 comments on commit 624315b

Please sign in to comment.