@Before public void setParameters() { order = new Order(); order.setStatus(OrderStatus.PAYMENT_PENDING); order.setDeliveryMethod(DeliveryMethod.UNKNOWN); order.setPayMethod(PaymentMethod.UNKNOWN); order.setPaid(false); }
@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); }
@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); }