Class OrderSourcingIntegrationTest

    • Constructor Detail

      • OrderSourcingIntegrationTest

        public OrderSourcingIntegrationTest()
    • Method Detail

      • setUp

        public void setUp()
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • cleanUp

        public void cleanUp()
      • updateTaskAssignmentWorkflowWithPackShippingConsignment

        public void updateTaskAssignmentWorkflowWithPackShippingConsignment()
                                                                     throws java.lang.InterruptedException
        Given that a consignment is Packed the Task Assignment Workflow must also be updated. Result: The task assignment workflow is in the Shipping step
        Throws:
        java.lang.InterruptedException
      • updateTaskAssignmentWorkflowWithPackPickUpConsignment

        public void updateTaskAssignmentWorkflowWithPackPickUpConsignment()
                                                                   throws java.lang.InterruptedException
        Given that a consignment is Packed the Task Assignment Workflow must also be updated. Result: The task assignment workflow is in the Ready for Pick up step
        Throws:
        java.lang.InterruptedException
      • updateTaskAssignmentWorkflowWithShipConsignment

        public void updateTaskAssignmentWorkflowWithShipConsignment()
                                                             throws java.lang.InterruptedException
        Given that a consignment is Shipped the Task Assignment Workflow must also be updated. Result: The task assignment workflow is terminated
        Throws:
        java.lang.InterruptedException
      • updateTaskAssignmentWorkflowWithPickupConsignment

        public void updateTaskAssignmentWorkflowWithPickupConsignment()
                                                               throws java.lang.InterruptedException
        Given that a pickup consignment is Shipped the Task Assignment Workflow must also be updated. Result: The task assignment workflow is terminated
        Throws:
        java.lang.InterruptedException
      • shouldSourcingSuccess_SingleEntry

        public void shouldSourcingSuccess_SingleEntry()
                                               throws java.lang.InterruptedException
        Given an shipping order with 1 entries:
        entry 1 : {quantity: 3, product: camera}
        Result:
        Verify the order status and consignment result
        Throws:
        java.lang.InterruptedException
      • shouldNotSourceSourcingConfigNull

        public void shouldNotSourceSourcingConfigNull()
                                               throws java.lang.InterruptedException
        Given an shipping order with 1 entries:
        entry 1 : {quantity: 3, product: camera}
        Result:
        The BaseStoreModel for the Order does not have SourcingConfigModel.
        So the sourcing fails and order status changes to Suspended.

        Later a SourcingConfigModel is provided for the BaseStoreModel, and as a result:
        1). Sourcing is successful and consignment is created
        2). The order status changes to Ready
        3). The ATP is reduced by the ordered Qty
        Throws:
        java.lang.InterruptedException
      • shouldSourcingSuccess_SingleEntry_PickUp

        public void shouldSourcingSuccess_SingleEntry_PickUp()
                                                      throws java.lang.InterruptedException
        Given an pickup order with 1 entries:
        entry 1 : {quantity: 3, product: camera}
        Result:
        Verify the order status and consignment result
        Throws:
        java.lang.InterruptedException
      • shouldSourcingFail_SingleEntry

        public void shouldSourcingFail_SingleEntry()
                                            throws java.lang.InterruptedException
        Given an shipping order with 1 entries:
        entry 1 : {quantity: 3, product: camera}
        Result:
        Verify the order sourcing failed
        Throws:
        java.lang.InterruptedException
      • shouldSourcingSuccess_Priority

        public void shouldSourcingSuccess_Priority()
                                            throws java.lang.InterruptedException
        Given an shipping order with 1 entries:
        entry 1 : {quantity: 3, product: camera}
        Result:
        Verify the order status and consignment result
        Throws:
        java.lang.InterruptedException
      • shouldPickLocationWithLowerScore

        public void shouldPickLocationWithLowerScore()
                                              throws java.lang.InterruptedException
        Given an shipping order with 1 entries:
        entry 1 : {quantity: 3, product: camera}
        Result:
        Second location should be picked, even if the first one has higher score.
        That's because of fitness strategy - second warehouse is able to make whole order at one time.
        Throws:
        java.lang.InterruptedException
      • shouldTakeAllFromFirstLocationAndTheRestFromSecond

        public void shouldTakeAllFromFirstLocationAndTheRestFromSecond()
                                                                throws java.lang.InterruptedException
        Given an shipping order with 1 entries:
        entry 1 : {quantity: 3, product: camera}
        Result:
        In this case, both locations cannot send order at one time. All products will be taken from first location - because of the higher score.
        To make whole order - the one product which is left will be taken from second location.
        Throws:
        java.lang.InterruptedException
      • shouldTakeAllFromLocationWithHigherScore

        public void shouldTakeAllFromLocationWithHigherScore()
                                                      throws java.lang.InterruptedException
        Given an shipping order with 1 entries:
        entry 1 : {quantity: 3, product: camera}
        Result:
        Whole order will be delivered from first location because score is higher.
        Throws:
        java.lang.InterruptedException
      • shouldSourcingSuccess_DistanceMontreal

        public void shouldSourcingSuccess_DistanceMontreal()
                                                    throws java.lang.InterruptedException
        Given an shipping order with 1 entries:
        entry 1 : {quantity: 3, product: camera}
        Result:
        Verify the location where it is assigned
        Throws:
        java.lang.InterruptedException
      • shouldSourcingSuccess_DistanceBoston

        public void shouldSourcingSuccess_DistanceBoston()
                                                  throws java.lang.InterruptedException
        Given an shipping order with 1 entries:
        entry 1 : {quantity: 3, product: camera}
        Result:
        Verify the location where it is assigned
        Throws:
        java.lang.InterruptedException
      • shouldSourcingSuccess_MultiEntry_SingleConsignment

        public void shouldSourcingSuccess_MultiEntry_SingleConsignment()
                                                                throws java.lang.InterruptedException
        Given an shipping order with 2 entries:
        entry 1 : {quantity: 3, product: camera}
        entry 2 : {quantity: 2, product: memoryCard}
        Result:
        Verify the order status and consignment result
        Throws:
        java.lang.InterruptedException
      • shouldSourcingSuccess_MultiEntries_MultiConsignments

        public void shouldSourcingSuccess_MultiEntries_MultiConsignments()
                                                                  throws java.lang.InterruptedException
        Given an shipping order with 2 entries:
        entry 1 : {quantity: 3, product: camera}
        entry 2 : {quantity: 2, product: memoryCard}
        Result:
        Verify the order status and consignment result
        Throws:
        java.lang.InterruptedException
      • shouldSourcingSuccess_MultiEntries_MultiConsignments_SplitOrderEntries

        public void shouldSourcingSuccess_MultiEntries_MultiConsignments_SplitOrderEntries()
                                                                                    throws java.lang.InterruptedException
        Given an shipping order with 2 entries:
        entry 1 : {quantity: 3, product: camera}
        entry 2 : {quantity: 2, product: memoryCard}
        Result:
        Verify the order status and consignment result
        Throws:
        java.lang.InterruptedException
      • shouldSourcingSuccess_OMSE_640

        public void shouldSourcingSuccess_OMSE_640()
                                            throws java.lang.InterruptedException
        Given an order with 3 entries:
        entry 1 : {quantity: 1, product: product1}
        entry 2 : {quantity: 1, product: product2}
        entry 3 : {quantity: 7, product: product3}
        POS Montreal ->Montreal product1 quantity=6, product2 quantity =6, product3 quantity = 6 POS Boston ->Boston product1 quantity=6, product2 quantity =6, product3 quantity = 0 POS Toronto ->Toronto product1 quantity=0, product2 quantity =0, product3 quantity = 6 Result:
        It should source complete from 2 location, 6 of product3 from Montreal, and 1 from the Toronto
        Throws:
        java.lang.InterruptedException
      • shouldNotConfirmTwice

        public void shouldNotConfirmTwice()
                                   throws java.lang.InterruptedException
        Given an shipping order with 1 entries:
        entry 1 : {quantity: 3, product: camera}
        Result:
        Verify cannot confirm order twice
        Throws:
        java.lang.InterruptedException
      • shouldSourcingSuccess_ExternalWarehouse

        public void shouldSourcingSuccess_ExternalWarehouse()
                                                     throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • shouldFailSourcing_ExternalWarehouse

        public void shouldFailSourcing_ExternalWarehouse()
                                                  throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException