BaseMultiFieldValidator extends DefaultBeanValidator { @Override public void validate(Object obj, Errors errors) { super.validate(obj, errors); if (!errors.hasErrors()) { validateMultiField(obj, errors); } }  @Override void validate(Object obj, Errors errors);  }
@Test public void testValidate01() throws Exception { BaseMultiFieldValidatorImpl01 validator = new BaseMultiFieldValidatorImpl01(); BaseMultiFieldValidator_ValidatorFactoryStub01 factory = new BaseMultiFieldValidator_ValidatorFactoryStub01(); BaseMutiFieldValidator_ValidatorStub01 commonsValidator = new BaseMutiFieldValidator_ValidatorStub01(); factory.setValidator(commonsValidator); validator.setValidatorFactory(factory); Object obj = new Object(); Errors errors = new BaseMultiFieldValidator_BindExceptionStub01(obj, ""); validator.validate(obj, errors); assertTrue(commonsValidator.isValidate); assertSame(obj, validator.obj); assertSame(errors, validator.errors); }
@Test public void testValidate02() throws Exception { BaseMultiFieldValidatorImpl01 validator = new BaseMultiFieldValidatorImpl01(); BaseMultiFieldValidator_ValidatorFactoryStub01 factory = new BaseMultiFieldValidator_ValidatorFactoryStub01(); BaseMutiFieldValidator_ValidatorStub01 commonsValidator = new BaseMutiFieldValidator_ValidatorStub01(); factory.setValidator(commonsValidator); validator.setValidatorFactory(factory); Object obj = new Object(); Errors errors = new BaseMultiFieldValidator_BindExceptionStub02(obj, ""); validator.validate(obj, errors); assertTrue(commonsValidator.isValidate); assertSame(null, validator.obj); assertSame(null, validator.errors); }