Class OrderCancelPartialTest

All Implemented Interfaces:
JaloSessionHolder
Direct Known Subclasses:
OrderManagementOrderCancelPartialTest

public class OrderCancelPartialTest extends AbstractOrderCancelTest
Tests partial cancel execution in different scenarios.
  • Constructor Details

    • OrderCancelPartialTest

      public OrderCancelPartialTest()
  • Method Details

    • customSetUp

      public void customSetUp() throws InvalidCartException
      Throws:
      InvalidCartException
    • testPartialCancelationBeforeWarehouse

      public void testPartialCancelationBeforeWarehouse() throws Exception
      Given an Order that contains a set of order entries containing items (products) and Partial Order Cancellation is possible and the Order hasn't been sent to the warehouse yet (Order queue waiting time has not expired) then after Order Cancel Partial Request:

      Order Cancel Entry should be created and set to "complete" state Canceled order entries should be removed. Order should be recalculated according to new set of Order Entries. State of the Order is unchanged.

      Throws:
      Exception
    • testPartialEntryCancelationBeforeWarehouse

      public void testPartialEntryCancelationBeforeWarehouse() throws Exception
      Given an Order that contains a set of order entries containing items (products) and Partial Order Entry Cancellation is possible and the Order hasn't been sent to the warehouse yet (Order queue waiting time has not expired) then after Order Cancel Partial Request:

      Order Cancel Entry should be created and set to "complete" state Quantity of order entries subject to cancelling should be reduced. Order should be recalculated according to new set of Order Entries. State of the Order is unchanged.

      Throws:
      Exception
    • testWarehouseResponsePartialCancelOK

      public void testWarehouseResponsePartialCancelOK() throws Exception
      Given an Order that contains a set of order entries containing items (products) and Order Cancel Entry with "pending" state then after Cancel Successful Warehouse response

      Order Cancel Entry should be updated with "completed" status. Canceled order entries should be removed. Order should be recalculated according to new set of Order Entries. State of the Order is restored to original value (before cancel request).

      Throws:
      Exception
    • testWarehouseResponsePartialEntryCancelOK

      public void testWarehouseResponsePartialEntryCancelOK() throws Exception
      Given an Order that contains a set of order entries containing items (products) and Order Cancel Entry with "pending" state then after Cancel Successful Warehouse response

      Order Cancel Entry should be updated with "completed" status. Order entries subject to cancel should have their quantity reduced. Order should be recalculated according to new set of Order Entries. State of the Order is restored to original value (before cancel request).

      Throws:
      Exception
    • testWarehouseResponsePartialCancelDenied

      public void testWarehouseResponsePartialCancelDenied() throws Exception
      Given an Order that contains a set of order entries containing items (products) and Order Cancel Entry with "pending" state then after Cancel Denied Warehouse response

      Order Cancel Entry should be updated with "completed" status and reason code. State of the Order is restored to original value (before cancel request).

      Throws:
      Exception
    • testWarehouseResponsePartialEntryCancelDenied

      public void testWarehouseResponsePartialEntryCancelDenied() throws Exception
      Given an Order that contains a set of order entries containing items (products) and Order Cancel Entry with "pending" state then after Cancel Denied Warehouse response

      Order Cancel Entry should be updated with "completed" status and reason code. State of the Order is restored to original value (before cancel request).

      Throws:
      Exception
    • testWarehouseResponsePartialCancelPartialOK

      public void testWarehouseResponsePartialCancelPartialOK() throws Exception
      Given an Order that contains a set of order entries containing items (products) and Order Cancel Entry with "pending" state then after Cancel Partially Successful Warehouse response

      Order Cancel Entry should be updated with "completed" status and reason code, and list of product entries that were cancelled. Canceled order entries should be removed. Order entries subject to partial cancel should have their quantity reduced. Order should be recalculated according to new set of Order Entries. State of the Order is restored to original value (before cancel request).

      Throws:
      Exception
    • testAllCancelableOrderEntriesNoConsignments

      public void testAllCancelableOrderEntriesNoConsignments()
      This verifies that method OrderCancelService.getAllCancelableEntries(OrderModel, PrincipalModel) returns information that every entry can be completely canceled when order has no consignments
    • testAllCancelableOrderEntriesWithConsignments

      public void testAllCancelableOrderEntriesWithConsignments()
      This verifies that method OrderCancelService.getAllCancelableEntries(OrderModel, PrincipalModel) returns information that every entry can be completely canceled when order is splitted into consignments and every consignment has a status READY and no item has been shipped
    • testSomeCancelableOrderEntriesWithConsignments

      public void testSomeCancelableOrderEntriesWithConsignments()
      This verifies that method OrderCancelService.getAllCancelableEntries(OrderModel, PrincipalModel) returns information that:
      • order entries that belongs to consignments with status SHIPPED cannot be cancelled
      • order entries that belongs to consignments with status READY and no items are shipped can be cancelled completely
      • order entries that belongs to consignments with status READY and some items are shipped can be cancelled only partially