use of org.mongodb.morphia.entities.SimpleEntity in project morphia by mongodb.
the class EntityAnnotatedValueValidatorTest method shouldAllowValueWithEntityAnnotationAndTypeOfKey.
@Test
public void shouldAllowValueWithEntityAnnotationAndTypeOfKey() {
// given
ArrayList<ValidationFailure> validationFailures = new ArrayList<ValidationFailure>();
// when
boolean validationApplied = EntityAnnotatedValueValidator.getInstance().apply(Key.class, new SimpleEntity(), validationFailures);
// then
assertThat(validationApplied, is(true));
assertThat(validationFailures.size(), is(0));
}
use of org.mongodb.morphia.entities.SimpleEntity in project morphia by mongodb.
the class EntityAnnotatedValueValidatorTest method shouldNotValidateValueWithEntityAnnotationAndNonKeyType.
@Test
public void shouldNotValidateValueWithEntityAnnotationAndNonKeyType() {
// given
ArrayList<ValidationFailure> validationFailures = new ArrayList<ValidationFailure>();
// when
boolean validationApplied = EntityAnnotatedValueValidator.getInstance().apply(String.class, new SimpleEntity(), validationFailures);
// then
assertThat(validationApplied, is(false));
assertThat(validationFailures.size(), is(0));
}
use of org.mongodb.morphia.entities.SimpleEntity in project morphia by mongodb.
the class KeyValueTypeValidatorTest method shouldNotValidateWhenValueIsNotAKey.
@Test
public void shouldNotValidateWhenValueIsNotAKey() {
// given
ArrayList<ValidationFailure> validationFailures = new ArrayList<ValidationFailure>();
// when
boolean validationApplied = KeyValueTypeValidator.getInstance().apply(String.class, new SimpleEntity(), validationFailures);
// then
assertThat(validationApplied, is(false));
assertThat(validationFailures.size(), is(0));
}
Aggregations