@Test public void testValidationFailure() { assertFalse(underTest.isValid("asd", context)); assertFalse(underTest.isValid("thisisaverylongstacknamewhichisnotallowedbecauseitistoolong", context)); }
@Override public boolean isValid(String value, ConstraintValidatorContext context) { return Range.between(MIN_LENGTH, MAX_LENGTH).contains(value.length()); }
StackNameLengthValidator implements ConstraintValidator<ValidStackNameLength, String> { @Override public boolean isValid(String value, ConstraintValidatorContext context) { return Range.between(MIN_LENGTH, MAX_LENGTH).contains(value.length()); } }
StackNameLengthValidator implements ConstraintValidator<ValidStackNameLength, String> { @Override public boolean isValid(String value, ConstraintValidatorContext context) { return Range.between(MIN_LENGTH, MAX_LENGTH).contains(value.length()); }  }
StackNameLengthValidator implements ConstraintValidator<ValidStackNameLength, String> { @Override public boolean isValid(String value, ConstraintValidatorContext context) { return Range.between(MIN_LENGTH, MAX_LENGTH).contains(value.length()); }  @Override boolean isValid(String value, ConstraintValidatorContext context); }
StackNameLengthValidator implements ConstraintValidator<ValidStackNameLength, String> { @Override public boolean isValid(String value, ConstraintValidatorContext context) { return Range.between(MIN_LENGTH, MAX_LENGTH).contains(value.length()); }  @Override boolean isValid(String value, ConstraintValidatorContext context);  }