@Test public void test_isValid_string() { String fieldName = "value-field-Name"; String collectionName = "value-collection-Name"; Set<String> alreadySeen = new HashSet<>(); for (String value : new String[] { null, "", " " }) { Assert.assertFalse(_validator.isUnique(value, alreadySeen, fieldName, collectionName, _failures)); _utils.checkFailureForMissingValue(_failures, fieldName); } String value = "blah"; _failures.clear(); Assert.assertTrue(_validator.isUnique(value, alreadySeen, fieldName, collectionName, _failures)); Assert.assertTrue(_failures.isEmpty()); Assert.assertTrue(alreadySeen.contains(value)); _failures.clear(); Assert.assertFalse(_validator.isUnique(value, alreadySeen, fieldName, collectionName, _failures)); _utils.checkFailureForSemanticError(_failures, fieldName, value); value = "bLaH"; _failures.clear(); Assert.assertFalse(_validator.isUnique(value, alreadySeen, fieldName, collectionName, _failures)); _utils.checkFailureForSemanticError(_failures, fieldName, value); }
boolean isUnique(Long value, Set<Long> alreadySeen, String valueName, String collectionName, List<ValidationFailureDetails> failures) { return isUnique(value, null, alreadySeen, valueName, collectionName, failures); }
RangerValidator { boolean isUnique(Long value, Set<Long> alreadySeen, String valueName, String collectionName, List<ValidationFailureDetails> failures) { return isUnique(value, null, alreadySeen, valueName, collectionName, failures); } }
RangerValidator { boolean isUnique(Long value, Set<Long> alreadySeen, String valueName, String collectionName, List<ValidationFailureDetails> failures) { return isUnique(value, null, alreadySeen, valueName, collectionName, failures); } protected  RangerValidator(ServiceStore store); protected  RangerValidator(RoleStore roleStore); }
RangerValidator { boolean isUnique(Long value, Set<Long> alreadySeen, String valueName, String collectionName, List<ValidationFailureDetails> failures) { return isUnique(value, null, alreadySeen, valueName, collectionName, failures); } protected  RangerValidator(ServiceStore store); protected  RangerValidator(RoleStore roleStore); void validate(Long id, Action action); void validate(String name, Action action); static String serializeFailures(List<ValidationFailureDetails> failures); }
RangerValidator { boolean isUnique(Long value, Set<Long> alreadySeen, String valueName, String collectionName, List<ValidationFailureDetails> failures) { return isUnique(value, null, alreadySeen, valueName, collectionName, failures); } protected  RangerValidator(ServiceStore store); protected  RangerValidator(RoleStore roleStore); void validate(Long id, Action action); void validate(String name, Action action); static String serializeFailures(List<ValidationFailureDetails> failures);  }