### Question:
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);  }### Answer:
@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"); }
@Test public void onBudgetShouldNotBeEmpty() { final AccountResource resource = new AccountResource("Cash", null); final BeanPropertyBindingResult errors = createBindingResult(resource); testSubject.validate(resource, errors); assertThat(errors.getFieldError("onBudget").getCode()).isEqualTo("onBudget.empty"); }