@Test public void descriptionShouldNotBeEmpty() { final AccountResource resource = new AccountResource("", true); final BeanPropertyBindingResult errors = createBindingResult(resource); testSubject.validate(resource, errors); assertThat(errors.getFieldError("description").getCode()).isEqualTo("description.empty"); }
@Override public void validate(Object target, Errors errors) { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "description", "description.empty"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "onBudget", "onBudget.empty"); }
AccountResourceValidator implements Validator { @Override public void validate(Object target, Errors errors) { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "description", "description.empty"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "onBudget", "onBudget.empty"); } }
AccountResourceValidator implements Validator { @Override public void validate(Object target, Errors errors) { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "description", "description.empty"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "onBudget", "onBudget.empty"); }  }
AccountResourceValidator implements Validator { @Override public void validate(Object target, Errors errors) { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "description", "description.empty"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "onBudget", "onBudget.empty"); }  @Override boolean supports(Class<?> clazz); @Override void validate(Object target, Errors errors); }
AccountResourceValidator implements Validator { @Override public void validate(Object target, Errors errors) { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "description", "description.empty"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "onBudget", "onBudget.empty"); }  @Override boolean supports(Class<?> clazz); @Override void validate(Object target, Errors errors);  }