Class OrderOnHoldIntegrationTest

    • Constructor Detail

      • OrderOnHoldIntegrationTest

        public OrderOnHoldIntegrationTest()
    • Method Detail

      • setUp

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

        public void cleanUp()
      • shouldPutOrderOnHold

        public void shouldPutOrderOnHold()
                                  throws java.lang.InterruptedException,
                                         OrderCancelException
        Given an order with 1 entries and put this order on hold:
        entry 1 : {quantity: 3, product: product1}
        Consignment 1 : {quantity: 3, product: product1, Ready}

        Result:
        1. Consignment 1 should be cancelled

        Assert:
        It verifies the cancelled consignment

        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldPutPartiallyDeclinedOrderOnHold

        public void shouldPutPartiallyDeclinedOrderOnHold()
                                                   throws java.lang.InterruptedException,
                                                          OrderCancelException
        Given a partially declined order with 1 entries and put this order on hold:
        entry 1 : {quantity: 3, product: product1}
        Consignment 1 : {quantity: 2, quantityDeclined: 1, product: product1, Ready}
        Consignment 2 : {quantity: 1, product: product1, Ready}

        Result:
        1. Consignment 1 should be cancelled
        2. Consignment 2 should be cancelled

        Assert:
        It verifies the cancelled consignments

        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldPutPartiallyCancelledOrderOnHoldAndCancelPartiallyAgain

        public void shouldPutPartiallyCancelledOrderOnHoldAndCancelPartiallyAgain()
                                                                           throws java.lang.InterruptedException,
                                                                                  OrderCancelException
        Given a partially cancelled order with 1 entries and put this order on hold:
        entry 1 : {quantity: 3, product: product1}
        Consignment 1 : {quantity: 3, product: product1, Cancelled}
        Consignment 2 : {quantity: 2, product: product1, Ready}

        Result:
        1. Consignment 1 should be cancelled
        2. Consignment 2 should be cancelled

        Assert:
        It verifies the cancelled consignments

        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldReSourceOnHoldOrder

        public void shouldReSourceOnHoldOrder()
                                       throws java.lang.InterruptedException,
                                              OrderCancelException
        Given an on hold order with 1 entries and re-source this order
        entry 1 : {quantity: 3, product: product1}
        Consignment 1 : {quantity: 3, product: product1, Cancelled}

        Result:
        1. Consignment 1 should be cancelled
        2. Consignment 2 should be Ready

        Assert:
        It verifies the consignments

        Throws:
        java.lang.InterruptedException
        OrderCancelException
      • shouldCancelOnHoldOrder

        public void shouldCancelOnHoldOrder()
                                     throws java.lang.InterruptedException,
                                            OrderCancelException
        Given an on hold order with 1 entries and cancel this order
        entry 1 : {quantity: 3, product: product1}
        Consignment 1 : {quantity: 3, product: product1, Cancelled}

        Result:
        1. Consignment 1 should be cancelled
        2. Order should be cancelled

        Assert:
        It verifies the cancelled order and consignment

        Throws:
        java.lang.InterruptedException
        OrderCancelException