use of org.qi4j.api.query.QueryException in project qi4j-sdk by Qi4j.
the class NonQueryableTest method testQueryIterable.
@Test
public void testQueryIterable() {
UnitOfWork unitOfWork = module.newUnitOfWork();
try {
module.newQueryBuilder(Abc2.class);
Assert.fail("Exception was expected.");
} catch (QueryException e) {
// expected!!
} finally {
unitOfWork.discard();
}
}
use of org.qi4j.api.query.QueryException in project qi4j-sdk by Qi4j.
the class NonQueryableTest method whenQuerableIsFalseOnPropertyThenExpectException.
@Test
public void whenQuerableIsFalseOnPropertyThenExpectException() {
UnitOfWork unitOfWork = module.newUnitOfWork();
try {
QueryBuilder<Abc> builder = module.newQueryBuilder(Abc.class);
Abc proto = templateFor(Abc.class);
builder.where(eq(proto.isValid(), Boolean.TRUE));
Assert.fail("Exception was expected.");
} catch (QueryException e) {
// expected!!
} finally {
unitOfWork.discard();
}
}
Aggregations