order = new Order();
order.setOrderId(Long.MAX_VALUE);
order.setOrderDate(new Date(new Date().getTime() - 1000));
order.setTotalLines(0);
List<LineItem> items = new ArrayList<LineItem>();
items.add(new LineItem());
order.setLineItems(items);
errors = new BeanPropertyBindingResult(order, "validOrder");
orderValidator.validateOrder(order, errors);
assertEquals(2, errors.getAllErrors().size());
assertEquals("error.order.id", errors.getFieldError("orderId").getCode());
assertEquals("error.order.lines.badcount", errors.getFieldError("totalLines").getCode());
order = new Order();
order.setOrderId(5L);
order.setOrderDate(new Date(new Date().getTime() - 1000));
order.setTotalLines(1);
items = new ArrayList<LineItem>();
items.add(new LineItem());
order.setLineItems(items);
errors = new BeanPropertyBindingResult(order, "validOrder");
orderValidator.validateOrder(order, errors);