ShoppingCartPaymentMethodEntity paymentMethod = (ShoppingCartPaymentMethodEntity) testObjects.get("paymentMethod");
MessageProcessor flow = lookupFlowConstruct("get-order");
MuleEvent response = flow.process(getTestEvent(testObjects));
SalesOrderEntity order = (SalesOrderEntity) response.getMessage().getPayload();
assertNotNull(order);
assertTrue(Integer.parseInt(order.getIncrement_id()) == Integer.parseInt(orderId));
assertTrue(order.getShipping_method().equals(shippingMethod));
assertTrue(order.getPayment().getMethod().equals(paymentMethod.getMethod()));
SalesOrderItemEntity[] products = order.getItems();
for (SalesOrderItemEntity product : products) {
int productId = Integer.parseInt(product.getProduct_id());
assertTrue(productIds.contains(productId));
}
}