Class CancellationIntegrationTest

    • Constructor Detail

      • CancellationIntegrationTest

        public CancellationIntegrationTest()
    • Method Detail

      • setUp

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

        public void cleanUp()
      • shouldCancelEntireOrderSuccess_SingleEntry

        public void shouldCancelEntireOrderSuccess_SingleEntry()
                                                        throws java.lang.InterruptedException,
                                                               OrderCancelException
        Given an order with 1 entries, and cancel:
        entry 1 : {quantity: 3, product: product1}

        Result:
        consignment should be cancelled

        Assert:
        It verifies the cancellation result

        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldCancelEntireOrderSuccess_SingleEntry_MultiStockLevel

        public void shouldCancelEntireOrderSuccess_SingleEntry_MultiStockLevel()
                                                                        throws java.lang.InterruptedException,
                                                                               OrderCancelException
        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldNotCancelMore_SingleEntry

        public void shouldNotCancelMore_SingleEntry()
                                             throws java.lang.InterruptedException,
                                                    OrderCancelException
        Given an order with 1 entries, and cancel more:
        entry 1 : {quantity: 3, product: product1}
        cancellation:{quantity:30, product: product1)}
        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldCancelEntireOrderSuccess_MultiEntry_SingleConsignment

        public void shouldCancelEntireOrderSuccess_MultiEntry_SingleConsignment()
                                                                         throws java.lang.InterruptedException,
                                                                                OrderCancelException
        Given an order with 2 entries, and cancel all:
        entry 1 : {quantity: 3, product: product1}
        entry 2 : {quantity: 3, product: product2}
        cancellation:{all}

        Result:
        consignment should be cancelled

        Assert:
        It verifies the cancellation result

        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldCancelEntireOrderSuccess_singleEntry_MultiConsignment

        public void shouldCancelEntireOrderSuccess_singleEntry_MultiConsignment()
                                                                         throws java.lang.InterruptedException,
                                                                                OrderCancelException
        Given an order with 1 entries sourced from 2 POS, and cancel all:
        entry 1 : {quantity: 3, product: Camera}
        cancellation:{all}

        Result:
        consignment should be cancelled

        Assert:
        It verifies the cancellation result

        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldCancelPartiallyOrderSuccess_SingleEntry

        public void shouldCancelPartiallyOrderSuccess_SingleEntry()
                                                           throws java.lang.InterruptedException,
                                                                  OrderCancelException
        Given an order with 1 entries, and cancel partially then create shipment
        entry 1 : {quantity: 3, product: product1}
        cancellation : {quantity: 2, product: product1}

        Result:
        1 shipment should be created with quantity 1

        Assert:
        It verifies the shipment result

        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldCancelPartiallyOrderSuccess_SingleEntry_MultiConsignments

        public void shouldCancelPartiallyOrderSuccess_SingleEntry_MultiConsignments()
                                                                             throws java.lang.InterruptedException,
                                                                                    OrderCancelException
        Given an order with 1 entry and 2 consigments, then cancel partially then create shipment
        entry 1 : {quantity: 3, product: product1}
        cancellation : {quantity: 2, product: product1}

        Result:
        generate a new optimized consignment

        Assert:
        It verifies the shipment result

        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldCancelPartiallyOrderAndResourceSuccess_SingleEntry

        public void shouldCancelPartiallyOrderAndResourceSuccess_SingleEntry()
                                                                      throws java.lang.InterruptedException,
                                                                             OrderCancelException
        Given an order with 1 entries, and cancel partially then create shipment
        entry 1 : {quantity: 3, product: product1}
        cancellation : {quantity: 2, product: product1}

        Result:
        1 shipment should be created with quantity 1

        Assert:
        It verifies a new consignment create from better location

        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldCancelUnallocatedQuantityFirst_SingleEntry

        public void shouldCancelUnallocatedQuantityFirst_SingleEntry()
                                                              throws java.lang.InterruptedException,
                                                                     OrderCancelException
        Given an order with 1 entries, partially sourced, and cancel partially then create shipment
        entry 1 : {quantity: 3, product: product1}
        cancellation : {quantity: 2, product: product1}

        Result:
        1 shipment should be created with quantity 1

        Assert:
        It cancel unallocated quantity without modify consignment

        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldCancelFail_alreadyShipped

        public void shouldCancelFail_alreadyShipped()
                                             throws java.lang.InterruptedException,
                                                    OrderCancelException
        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldCancelEntirePartiallyCancelledOrder_singleEntry

        public void shouldCancelEntirePartiallyCancelledOrder_singleEntry()
                                                                   throws java.lang.InterruptedException,
                                                                          OrderCancelException
        Given an order with 1 entries, cancel entire order which already has been partially cancelled
        entry 1 : {quantity: 3, product: product1}
        cancellation : {quantity: 1, product: product1}
        cancellation : {quantity: 2, product: product1}

        Result:
        order should be cancel complete

        Assert:
        order status in cancel

        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldCancelOrderSuccess_MultiOrderEntry_OMSE_1446

        public void shouldCancelOrderSuccess_MultiOrderEntry_OMSE_1446()
                                                                throws java.lang.InterruptedException,
                                                                       OrderCancelException
        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldCancelOrderSuccess_PartiallySourced_OMSE_1440

        public void shouldCancelOrderSuccess_PartiallySourced_OMSE_1440()
                                                                 throws java.lang.InterruptedException,
                                                                        OrderCancelException
        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldCancelOrderSuccess_NothingToSource

        public void shouldCancelOrderSuccess_NothingToSource()
                                                      throws java.lang.InterruptedException,
                                                             OrderCancelException
        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldCancelOrderSuccess_PartiallySourcedANdPartiallyConfirmed_OMSE_1454

        public void shouldCancelOrderSuccess_PartiallySourcedANdPartiallyConfirmed_OMSE_1454()
                                                                                      throws java.lang.InterruptedException,
                                                                                             OrderCancelException
        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldPartialCancelPotentialFraudOrderSuccess_SingleEntry

        public void shouldPartialCancelPotentialFraudOrderSuccess_SingleEntry()
                                                                       throws java.lang.InterruptedException,
                                                                              OrderCancelException
        Given an order with 1 entry {quantity: 23, product: product1} and status WAIT_FRAUD_MANUAL_CHECK:
        Partial Cancel : {quantity: 3, product: product1}

        Result:
        Order status should still be WAIT_FRAUD_MANUAL_CHECK, while the order entry's quantity get reduced by 3

        Assert:
        It verifies the cancellation result

        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldCompleteCancelPotentialFraudOrderSuccess_SingleEntry

        public void shouldCompleteCancelPotentialFraudOrderSuccess_SingleEntry()
                                                                        throws java.lang.InterruptedException,
                                                                               OrderCancelException
        Given an order with 1 entry {quantity: 23, product: product1} and status WAIT_FRAUD_MANUAL_CHECK:
        Cancel the order completely

        Result:
        Order status should be Cancelled, while the order process moves to end state

        Assert:
        It verifies the cancellation result

        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldNotCreateEventWhenCancelWholeOrderFromExternalWarehouse

        public void shouldNotCreateEventWhenCancelWholeOrderFromExternalWarehouse()
                                                                           throws java.lang.InterruptedException,
                                                                                  OrderCancelException
        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldNotCreateEventWhenCancelPartialOrderFromExternalWarehouse

        public void shouldNotCreateEventWhenCancelPartialOrderFromExternalWarehouse()
                                                                             throws java.lang.InterruptedException,
                                                                                    OrderCancelException
        Throws:
        java.lang.InterruptedException
        OrderCancelException