}
@Test
public void testValidShipping() {
Order order = new Order();
ShippingInfo info = new ShippingInfo();
info.setShipperId("INVALID");
info.setShippingTypeId("INVALID");
order.setShipping(info);
Errors errors = new BeanPropertyBindingResult(order, "validOrder");
orderValidator.validateShipping(info, errors);
assertEquals(2, errors.getAllErrors().size());
assertEquals("error.shipping.shipper", errors.getFieldError("shipping.shipperId").getCode());
assertEquals("error.shipping.type", errors.getFieldError("shipping.shippingTypeId").getCode());
info = new ShippingInfo();
info.setShipperId("FEDX");
info.setShippingTypeId("EXP");
info.setShippingInfo("12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890");
order.setShipping(info);
errors = new BeanPropertyBindingResult(order, "validOrder");
orderValidator.validateShipping(info, errors);
assertEquals(1, errors.getAllErrors().size());
assertEquals("error.shipping.shippinginfo.length", errors.getFieldError("shipping.shippingInfo").getCode());
info = new ShippingInfo();
info.setShipperId("FEDX");
info.setShippingTypeId("EXP");
info.setShippingInfo("Info");
order.setShipping(info);
errors = new BeanPropertyBindingResult(order, "validOrder");
orderValidator.validateShipping(info, errors);