### Question:
PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); @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() { validator.validate(0, validations, null); validator.validate(1222, validations, null); assertFalse(validationHelper.hasErrors()); }
@Test public void testValidateInvalid() { validator.validate(-1, validations, "testValidateInvalid"); assertTrue(validationHelper.hasErrors()); assertEquals(new Integer(1), new Integer(validationHelper.getCount())); assertEquals("testValidateInvalid", validationHelper.getValidation().get(0).getId()); }
@Test public void testValidateInvalidWarn() { validator.validate(-1, validations, "testValidateInvalidWarn", ValidationStatus.WARN); assertFalse(validationHelper.hasErrors()); assertTrue(validationHelper.hasWarnings()); assertEquals(new Integer(1), new Integer(validationHelper.getCount())); assertEquals("testValidateInvalidWarn", validationHelper.getValidation().get(0).getId()); }
@Test public void testValidateInvalidInfo() { validator.validate(-1, validations, "testValidateInvalidInfo", ValidationStatus.INFO); assertFalse(validationHelper.hasErrors()); assertFalse(validationHelper.hasWarnings()); assertTrue(validationHelper.hasInfos()); assertEquals(new Integer(1), new Integer(validationHelper.getCount())); assertEquals("testValidateInvalidInfo", validationHelper.getValidation().get(0).getId()); }
@Test public void testValidateWithErrorLevel() { validator.validate(0, validations, "testValidateWithErrorLevel", ValidationStatus.WARN); assertFalse(validationHelper.hasErrors()); assertFalse(validationHelper.hasWarnings()); assertFalse(validationHelper.hasInfos()); }