### Question:
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);  }### Answer:
@Test public void testValidate() { String pass = "1112332"; validator.validate(pass, validations, "testValidate"); assertFalse(validationHelper.hasErrors()); }
@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())); }