public Validator getValidator() {
return validator;
}
});
Enunciate enunciate = new Enunciate(new String[0]);
enunciate.setConfig(config);
EnunciateAnnotationProcessor processor = new EnunciateAnnotationProcessor(enunciate) {
@Override
protected Messager getMessager() {
return messager;
}
};
EnunciateFreemarkerModel model = new EnunciateFreemarkerModel();
model.add(ei);
model.add(beanOne);
model.add(beanTwo);
model.add(beanThree);
model.add(beanThreeElement);
processor.validate(model);
for (int i = 0; i < 3; i++) {
assertTrue("Endpoint interface should have been validated three (and only three) times.", validator.validatedObjects.remove(ei));
}
assertFalse("Endpoint interface should have been validated three (and only three) times.", validator.validatedObjects.remove(ei));
for (int i = 0; i < 3; i++) {
assertTrue("Bean one should have been validated three (and only three) times.", validator.validatedObjects.remove(beanOne));
}
assertFalse("Bean one should have been validated three (and only three) times.", validator.validatedObjects.remove(beanOne));
for (int i = 0; i < 3; i++) {
assertTrue("Bean two should have been validated three (and only three) times.", validator.validatedObjects.remove(beanTwo));
}
assertFalse("Bean two should have been validated three (and only three) times.", validator.validatedObjects.remove(beanTwo));
for (int i = 0; i < 3; i++) {
assertTrue("Bean three should have been validated three (and only three) times.", validator.validatedObjects.remove(beanThree));
}
for (int i = 0; i < 3; i++) {
assertTrue("Bean three element should have been validated three (and only three) times.", validator.validatedObjects.remove(beanThreeElement));
}
assertFalse("Bean three should have been validated three (and only three) times.", validator.validatedObjects.remove(beanThree));
assertFalse("Bean three element should have been validated three (and only three) times.", validator.validatedObjects.remove(beanThreeElement));
enunciate.setConfig(config);
processor = new EnunciateAnnotationProcessor(enunciate) {
@Override
protected ValidationResult validate(EnunciateFreemarkerModel model, Validator validator) {
ValidationResult result = new ValidationResult();
result.addWarning(beanThree, "test warning.");