OrderFormValidator implements Validator { @Override public void validate(Object object, Errors errors) { Order order = (Order) object; String customer = order.getCustomer().toString(); LOGGER.debug(customer); if(customer == null || StringUtils.isEmpty(customer)) { errors.rejectValue("customer", "error.empty.customer"); } }  @Override boolean supports(Class<?> c1); @Override void validate(Object object, Errors errors);  }
@Test @Ignore public void testValidate() { Order createOrderForm = new Order(); Errors errors = new BeanPropertyBindingResult(null, ""); orderFormValidator.validate(createOrderForm, errors); }