Пример #1
0
 @Before
 public void setParameters() {
   order = new Order();
   order.setStatus(OrderStatus.PAYMENT_PENDING);
   order.setDeliveryMethod(DeliveryMethod.UNKNOWN);
   order.setPayMethod(PaymentMethod.UNKNOWN);
   order.setPaid(false);
 }
Пример #2
0
 @Test
 public void cancelDevliveryChangedOrderTest2() {
   order.setDeliveryMethod(DeliveryMethod.COURIER);
   if (order.getStatus().equals(OrderStatus.PAYMENT_PENDING)
       || order.getPayMethod().equals(PaymentMethod.UNKNOWN)
       || order.getDeliveryMethod().equals(DeliveryMethod.UNKNOWN)) {
     order.setStatus(OrderStatus.CANCELED);
   }
   assertEquals(order.getStatus(), OrderStatus.CANCELED);
 }
Пример #3
0
  @Test
  public void cancelAlreadyCreatedOrderTest() {

    if (order.getStatus().equals(OrderStatus.PAYMENT_PENDING)
        || order.getPayMethod().equals(PaymentMethod.UNKNOWN)
        || order.getDeliveryMethod().equals(DeliveryMethod.UNKNOWN)) {

      order.setStatus(OrderStatus.CANCELED);
    }
    assertEquals(order.getStatus(), OrderStatus.CANCELED);
  }