@Test
@TestForIssue(jiraKey = "HV-381")
public void testFailFastSetWithProperty() {
// with fail fast
HibernateValidatorConfiguration configuration = ValidatorUtil.getConfiguration( HibernateValidator.class );
ValidatorFactory factory = configuration.addProperty( HibernateValidatorConfiguration.FAIL_FAST, "true" )
.buildValidatorFactory();
Validator validator = factory.getValidator();
Set<ConstraintViolation<A>> constraintViolations = validator.validate( testInstance );
assertNumberOfViolations( constraintViolations, 1 );
// without fail fast
configuration = ValidatorUtil.getConfiguration( HibernateValidator.class );
factory = configuration.addProperty( HibernateValidatorConfiguration.FAIL_FAST, "false" )
.buildValidatorFactory();
validator = factory.getValidator();
constraintViolations = validator.validate( testInstance );
assertNumberOfViolations( constraintViolations, 2 );