use of org.folio.rest.jaxrs.model.PatchOrderLineRequest in project mod-orders by folio-org.
the class OrderLineUpdateInstanceHandlerTest method shouldThrowNotImplementedExceptionForPhysicalOrderFormat.
@Test
public void shouldThrowNotImplementedExceptionForPhysicalOrderFormat() {
String orderLineId = UUID.randomUUID().toString();
PoLine poLine = new PoLine().withId(orderLineId).withOrderFormat(PoLine.OrderFormat.PHYSICAL_RESOURCE).withPhysical(new Physical().withCreateInventory(Physical.CreateInventory.INSTANCE_HOLDING));
PatchOrderLineRequest patchOrderLineRequest = new PatchOrderLineRequest();
patchOrderLineRequest.withOperation(PatchOrderLineRequest.Operation.REPLACE_INSTANCE_REF);
OrderLineUpdateInstanceHolder orderLineUpdateInstanceHolder = new OrderLineUpdateInstanceHolder().withStoragePoLine(poLine).withPathOrderLineRequest(patchOrderLineRequest);
assertThrows(NotImplementedException.class, () -> orderLineUpdateInstanceHandler.handle(orderLineUpdateInstanceHolder, requestContext));
}
use of org.folio.rest.jaxrs.model.PatchOrderLineRequest in project mod-orders by folio-org.
the class OrderLineUpdateInstanceHandlerTest method shouldThrowNotImplementedExceptionForOtherOrderFormat.
@Test
public void shouldThrowNotImplementedExceptionForOtherOrderFormat() {
String orderLineId = UUID.randomUUID().toString();
PoLine poLine = new PoLine().withId(orderLineId).withOrderFormat(PoLine.OrderFormat.OTHER).withPhysical(new Physical().withCreateInventory(Physical.CreateInventory.INSTANCE_HOLDING));
PatchOrderLineRequest patchOrderLineRequest = new PatchOrderLineRequest();
patchOrderLineRequest.withOperation(PatchOrderLineRequest.Operation.REPLACE_INSTANCE_REF);
OrderLineUpdateInstanceHolder orderLineUpdateInstanceHolder = new OrderLineUpdateInstanceHolder().withStoragePoLine(poLine).withPathOrderLineRequest(patchOrderLineRequest);
assertThrows(NotImplementedException.class, () -> orderLineUpdateInstanceHandler.handle(orderLineUpdateInstanceHolder, requestContext));
}
use of org.folio.rest.jaxrs.model.PatchOrderLineRequest in project mod-orders by folio-org.
the class OrderLineUpdateInstanceHandlerTest method shouldThrowNotImplementedExceptionForMIXOrderFormat.
@Test
public void shouldThrowNotImplementedExceptionForMIXOrderFormat() {
String orderLineId = UUID.randomUUID().toString();
PoLine poLine = new PoLine().withId(orderLineId).withOrderFormat(PoLine.OrderFormat.P_E_MIX).withPhysical(new Physical().withCreateInventory(Physical.CreateInventory.INSTANCE_HOLDING)).withEresource(new Eresource().withCreateInventory(Eresource.CreateInventory.INSTANCE));
PatchOrderLineRequest patchOrderLineRequest = new PatchOrderLineRequest();
patchOrderLineRequest.withOperation(PatchOrderLineRequest.Operation.REPLACE_INSTANCE_REF);
OrderLineUpdateInstanceHolder orderLineUpdateInstanceHolder = new OrderLineUpdateInstanceHolder().withStoragePoLine(poLine).withPathOrderLineRequest(patchOrderLineRequest);
assertThrows(NotImplementedException.class, () -> orderLineUpdateInstanceHandler.handle(orderLineUpdateInstanceHolder, requestContext));
}
use of org.folio.rest.jaxrs.model.PatchOrderLineRequest in project mod-orders by folio-org.
the class CompositePoLineAPI method patchOrdersOrderLinesById.
@Override
@Validate
public void patchOrdersOrderLinesById(String lineId, PatchOrderLineRequest request, Map<String, String> okapiHeaders, Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) {
RequestContext requestContext = new RequestContext(vertxContext, okapiHeaders);
orderLinePatchOperationService.patch(lineId, request, requestContext).thenAccept(v -> asyncResultHandler.handle(succeededFuture(buildNoContentResponse()))).exceptionally(t -> handleErrorResponse(asyncResultHandler, t));
}
use of org.folio.rest.jaxrs.model.PatchOrderLineRequest in project mod-orders by folio-org.
the class OrderLineUpdateInstanceHandlerTest method shouldThrowNotImplementedExceptionForEresourceOrderFormat.
@Test
public void shouldThrowNotImplementedExceptionForEresourceOrderFormat() {
String orderLineId = UUID.randomUUID().toString();
PoLine poLine = new PoLine().withId(orderLineId).withOrderFormat(PoLine.OrderFormat.ELECTRONIC_RESOURCE).withEresource(new Eresource().withCreateInventory(Eresource.CreateInventory.INSTANCE));
PatchOrderLineRequest patchOrderLineRequest = new PatchOrderLineRequest();
patchOrderLineRequest.withOperation(PatchOrderLineRequest.Operation.REPLACE_INSTANCE_REF);
OrderLineUpdateInstanceHolder orderLineUpdateInstanceHolder = new OrderLineUpdateInstanceHolder().withStoragePoLine(poLine).withPathOrderLineRequest(patchOrderLineRequest);
assertThrows(NotImplementedException.class, () -> orderLineUpdateInstanceHandler.handle(orderLineUpdateInstanceHolder, requestContext));
}
Aggregations