assertThat(e, exception("no validators"));
}
// wrong validators
v = newValidator();
v.setValidators(createValidatorList((Validator) new MyValidator()));
try {
v.afterPropertiesSet();
fail();
} catch (IllegalArgumentException e) {
assertThat(e, exception("expected <when>"));
}
v = newValidator();
v.setValidators(createValidatorList(new ChooseValidator.When(), new ChooseValidator.Otherwise(),
new ChooseValidator.When()));
try {
v.afterPropertiesSet();
fail();
} catch (IllegalArgumentException e) {
assertThat(e, exception("expected <when>"));
}
v = newValidator();
v.setValidators(createValidatorList(new ChooseValidator.When(), new MyValidator()));
try {
v.afterPropertiesSet();
fail();
} catch (IllegalArgumentException e) {