@Test public void shouldNotRejectIfTermsIsChecked() throws Exception { when(csePaymentFormMock.isTermsCheck()).thenReturn(true); testObj.validate(csePaymentFormMock, errorsMock); verify(errorsMock, never()).reject(CseFormValidator.CHECKOUT_ERROR_TERMS_NOT_ACCEPTED); }
@Override public void validate(final Object object, final Errors errors) { final CSEPaymentForm form = (CSEPaymentForm) object; if (StringUtils.isBlank(form.getCseToken())) { errors.reject(GLOBAL_MISSING_CSE_TOKEN); } if (!form.isTermsCheck()) { errors.reject(CHECKOUT_ERROR_TERMS_NOT_ACCEPTED); } }
CseFormValidator implements Validator { @Override public void validate(final Object object, final Errors errors) { final CSEPaymentForm form = (CSEPaymentForm) object; if (StringUtils.isBlank(form.getCseToken())) { errors.reject(GLOBAL_MISSING_CSE_TOKEN); } if (!form.isTermsCheck()) { errors.reject(CHECKOUT_ERROR_TERMS_NOT_ACCEPTED); } } }
CseFormValidator implements Validator { @Override public void validate(final Object object, final Errors errors) { final CSEPaymentForm form = (CSEPaymentForm) object; if (StringUtils.isBlank(form.getCseToken())) { errors.reject(GLOBAL_MISSING_CSE_TOKEN); } if (!form.isTermsCheck()) { errors.reject(CHECKOUT_ERROR_TERMS_NOT_ACCEPTED); } }  }
CseFormValidator implements Validator { @Override public void validate(final Object object, final Errors errors) { final CSEPaymentForm form = (CSEPaymentForm) object; if (StringUtils.isBlank(form.getCseToken())) { errors.reject(GLOBAL_MISSING_CSE_TOKEN); } if (!form.isTermsCheck()) { errors.reject(CHECKOUT_ERROR_TERMS_NOT_ACCEPTED); } }  @Override boolean supports(final Class<?> aClass); @Override void validate(final Object object, final Errors errors); }
CseFormValidator implements Validator { @Override public void validate(final Object object, final Errors errors) { final CSEPaymentForm form = (CSEPaymentForm) object; if (StringUtils.isBlank(form.getCseToken())) { errors.reject(GLOBAL_MISSING_CSE_TOKEN); } if (!form.isTermsCheck()) { errors.reject(CHECKOUT_ERROR_TERMS_NOT_ACCEPTED); } }  @Override boolean supports(final Class<?> aClass); @Override void validate(final Object object, final Errors errors);  }