validateErrorsPresent(validator, "123", 1);
validateErrorsPresent(validator, "foo", 1);
}
private void validateErrorsPresent(FieldValidator validator, String value, final int expectedValidationErrors) {
ValidatorMessageHolder messages = validator.validate(value, "");
int errors = 0;
if (messages instanceof ValidatorMessages) {
errors = errorCount((ValidatorMessages) messages);
} else {
if ( ((ValidatorMessage) messages).hasError()) {