use of ddf.catalog.validation.impl.validator.EnumerationValidator in project ddf by codice.
the class EnumerationValidatorTest method testHashCodeDifferentEnumerationValues.
@Test
public void testHashCodeDifferentEnumerationValues() {
final EnumerationValidator validator1 = new EnumerationValidator(Sets.newHashSet("first", "second"), false);
final EnumerationValidator validator2 = new EnumerationValidator(Sets.newHashSet("first", "third"), false);
assertThat(validator1.hashCode(), not(validator2.hashCode()));
}
use of ddf.catalog.validation.impl.validator.EnumerationValidator in project ddf by codice.
the class EnumerationValidatorTest method getReport.
private Optional<AttributeValidationReport> getReport(boolean ignoreCase, final Attribute attribute) {
final Set<String> enumeratedValuesSet = Arrays.stream(ENUMERATED_VALUES).collect(Collectors.toSet());
final EnumerationValidator validator = new EnumerationValidator(enumeratedValuesSet, ignoreCase);
return validator.validate(attribute);
}
use of ddf.catalog.validation.impl.validator.EnumerationValidator in project ddf by codice.
the class EnumerationValidatorTest method testEqualsDifferentEnumerationValues.
@Test
public void testEqualsDifferentEnumerationValues() {
final EnumerationValidator validator1 = new EnumerationValidator(Sets.newHashSet("first", "second"), false);
final EnumerationValidator validator2 = new EnumerationValidator(Sets.newHashSet("first", "third"), false);
assertThat(validator1.equals(validator2), is(false));
assertThat(validator2.equals(validator1), is(false));
}
use of ddf.catalog.validation.impl.validator.EnumerationValidator in project ddf by codice.
the class EnumerationValidatorTest method testEqualsNull.
@Test
public void testEqualsNull() {
final EnumerationValidator validator1 = new EnumerationValidator(Sets.newHashSet("first"), false);
assertThat(validator1.equals(null), is(false));
}
use of ddf.catalog.validation.impl.validator.EnumerationValidator in project ddf by codice.
the class EnumerationValidatorTest method testEquals.
@Test
public void testEquals() {
final EnumerationValidator validator1 = new EnumerationValidator(Sets.newHashSet("first", "second"), false);
final EnumerationValidator validator2 = new EnumerationValidator(Sets.newHashSet("first", "second"), false);
assertThat(validator1.equals(validator2), is(true));
assertThat(validator2.equals(validator1), is(true));
}
Aggregations