Search in sources :

Example 1 with OrderItem

use of uk.co.jemos.podam.test.dto.docs.example.OrderItem in project podam by devopsfolks.

the class WalkThroughSteps method theOrderPojoShouldBeCorrectlyFilled.

@Step("Then the Order POJO should be correctly filled")
public void theOrderPojoShouldBeCorrectlyFilled(Order pojo) {
    assertThat("The pojo cannot be null!", pojo, not(nullValue()));
    assertThat("The order id must not be zero!", pojo.getId(), not(equalTo(0)));
    Calendar createDate = pojo.getCreateDate();
    assertThat("The create date must not be null!", createDate, not(nullValue()));
    assertThat("The order total amount must not be zero!", pojo.getTotalAmount(), not(equalTo(0.0)));
    List<OrderItem> orderItems = pojo.getOrderItems();
    assertThat("The order items must not be null!", orderItems, not(nullValue()));
    assertThat("The order items must not be empty!", orderItems, is(not(empty())));
    int expectedNbrElements = 5;
    assertThat("The expected number of elements " + expectedNbrElements + " does not match the actual number: " + orderItems.size(), orderItems, hasSize(expectedNbrElements));
    for (OrderItem orderItem : orderItems) {
        theOrderItemPojoShouldBeCorrectlyFilled(orderItem);
    }
}
Also used : Calendar(java.util.Calendar) OrderItem(uk.co.jemos.podam.test.dto.docs.example.OrderItem) Step(net.thucydides.core.annotations.Step)

Aggregations

Calendar (java.util.Calendar)1 Step (net.thucydides.core.annotations.Step)1 OrderItem (uk.co.jemos.podam.test.dto.docs.example.OrderItem)1