@Test public void testValidateInvalid() { String pass = ""; validator.validate(pass, validations, "testValidateInvalid"); assertTrue(validationHelper.hasErrors()); assertEquals(new Integer(1), new Integer(validationHelper.getAllValidations().size())); Validation validation = validations.get(0); assertNotNull(validation); assertEquals(ValidationScope.MAPPING, validation.getScope()); assertEquals("testValidateInvalid", validation.getId()); assertTrue("Must be of this length".equals(validation.getMessage())); }
@Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); }
StringLengthValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } }
StringLengthValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } StringLengthValidator(ValidationScope scope, String violationMessage, int minLength, int maxLength); }
StringLengthValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } StringLengthValidator(ValidationScope scope, String violationMessage, int minLength, int maxLength); @Override boolean supports(Class<?> clazz); @Override void validate(Object target, List<Validation> validations, String id); @Override void validate(Object target, List<Validation> validations, String id, ValidationStatus status); }
StringLengthValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } StringLengthValidator(ValidationScope scope, String violationMessage, int minLength, int maxLength); @Override boolean supports(Class<?> clazz); @Override void validate(Object target, List<Validation> validations, String id); @Override void validate(Object target, List<Validation> validations, String id, ValidationStatus status);  }