Skip to content

Commit

Permalink
[MODORDERS-1174] Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Saba-Zedginidze-EPAM committed Sep 19, 2024
1 parent a301743 commit de4724e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/folio/helper/PurchaseOrderLineHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public Future<Void> updateOrderLine(CompositePoLine compOrderLine, RequestContex
return getPoLineByIdAndValidate(compOrderLine.getPurchaseOrderId(), compOrderLine.getId(), requestContext)
.map(lineFromStorage -> lineFromStorage.mapTo(PoLine.class))
.compose(poLineFromStorage -> getCompositePurchaseOrder(compOrderLine.getPurchaseOrderId(), requestContext)
.map(compOrder -> addLineToCompOrder(compOrder, poLineFromStorage))
.map(compOrder -> addLineToCompOrder(compOrder, JsonObject.mapFrom(poLineFromStorage)))
.map(compOrder -> {
validatePOLineProtectedFieldsChanged(compOrderLine, poLineFromStorage, compOrder);
PoLineCommonUtil.updateLocationsQuantity(compOrderLine.getLocations());
Expand Down Expand Up @@ -637,8 +637,8 @@ private Future<CompositePoLine> getLineWithInstanceId(CompositePoLine line, Requ
});
}

private CompositePurchaseOrder addLineToCompOrder(CompositePurchaseOrder compOrder, PoLine poLine) {
var compPoLine = JsonObject.mapFrom(poLine.withAlerts(null).withReportingCodes(null)).mapTo(CompositePoLine.class);
private CompositePurchaseOrder addLineToCompOrder(CompositePurchaseOrder compOrder, JsonObject lineFromStorage) {
var compPoLine = lineFromStorage.mapTo(CompositePoLine.class).withAlerts(Collections.emptyList()).withReportingCodes(Collections.emptyList());
compOrder.getCompositePoLines().add(compPoLine);
return compOrder;
}
Expand Down

0 comments on commit de4724e

Please sign in to comment.