@Test
public void findExpensiveOrders_should_selectCorrectlySummedUpItems() throws IOException {

    final Table orders = aTable(OrderTable.class)
            .withRowsBetween(1, 10)
            .allHaving(CUSTOMER_ID, CUSTOMER_1)
            .allHaving(CREATION, duringCreationDay);
    final Table orderItems = aTable(OrderItemTable.class)
            // let orders 1-7 have just too cheap products
            .withRowsBetween(101, 107)
            .having(ORDER_ID, 1, 2, 3, 4, 5, 6, 7)
            .allHaving(PRODUCT_ID, PRODUCT_1)
            .with(
                    // Order 8: Just not enough
                    aRow(108).f(ORDER_ID, 8).f(PRODUCT_ID, PRODUCT_10),
                    aRow(109).f(ORDER_ID, 8).f(PRODUCT_ID, PRODUCT_10),
                    aRow(110).f(ORDER_ID, 8).f(PRODUCT_ID, PRODUCT_10),
                    aRow(111).f(ORDER_ID, 8).f(PRODUCT_ID, PRODUCT_9_99),
                    // Order 9: Exactly 40.00
                    aRow(112).f(ORDER_ID, 9).f(PRODUCT_ID, PRODUCT_10),
                    aRow(113).f(ORDER_ID, 9).f(PRODUCT_ID, PRODUCT_10),
                    aRow(114).f(ORDER_ID, 9).f(PRODUCT_ID, PRODUCT_10),
                    aRow(115).f(ORDER_ID, 9).f(PRODUCT_ID, PRODUCT_10),
                    // Order 10: > 40.00
                    aRow(116).f(ORDER_ID, 10).f(PRODUCT_ID, PRODUCT_50)
            );
    daleq.insertIntoDatabase(orders, orderItems);
    final List<Order> actual = orderDao.findExpensiveOrders(CUSTOMER_1, creationDay, fortyEuro);
    assertContainsOrders(actual, order(8), order(9), order(10));
}