use of org.mongodb.morphia.mapping.MappedField in project morphia by mongodb.
the class QueryValidatorTest method shouldAllowValuesOfList.
@Test
public void shouldAllowValuesOfList() {
// expect
MappedClass mappedClass = new MappedClass(SimpleEntity.class, new Mapper());
MappedField mappedField = mappedClass.getMappedField("name");
assertThat(QueryValidator.isCompatibleForOperator(mappedClass, mappedField, List.class, EQUAL, new ArrayList<String>(), new ArrayList<ValidationFailure>()), is(true));
}
use of org.mongodb.morphia.mapping.MappedField in project morphia by mongodb.
the class QueryValidatorTest method shouldNotAllowSizeOperatorForNonIntegerValues.
@Test
public void shouldNotAllowSizeOperatorForNonIntegerValues() {
// expect
MappedClass mappedClass = new MappedClass(SimpleEntity.class, new Mapper());
MappedField mappedField = mappedClass.getMappedField("name");
assertThat(QueryValidator.isCompatibleForOperator(mappedClass, mappedField, ArrayList.class, SIZE, "value", new ArrayList<ValidationFailure>()), is(false));
}
use of org.mongodb.morphia.mapping.MappedField in project morphia by mongodb.
the class QueryValidatorTest method shouldNotAllowStringValueWithTypeThatIsNotString.
@Test
public void shouldNotAllowStringValueWithTypeThatIsNotString() {
// expect
MappedClass mappedClass = new MappedClass(SimpleEntity.class, new Mapper());
MappedField mappedField = mappedClass.getMappedField("name");
assertThat(QueryValidator.isCompatibleForOperator(mappedClass, mappedField, Integer.class, EQUAL, "value", new ArrayList<ValidationFailure>()), is(false));
}
Aggregations