101102103104105106107108109110111
assertThat(restriction.get("$lt"), is((Object) date.getMillis())); } @Test public void canGiveLimitAndSkip() { final QueryExecutor executor = mock(QueryExecutor.class); final Criteria criteria = new Criteria(executor); criteria.limit(10); criteria.skip(3); criteria.list();
117118119120121122123124125126127
assertThat(cursorParameter.getSkip(), is(3)); } @Test public void canSort() { final QueryExecutor executor = mock(QueryExecutor.class); final Criteria criteria = new Criteria(executor); criteria.sort("field", Order.ASCENDING); criteria.list();
129130131132133134135
return criteria; } @SuppressWarnings("unchecked") private QueryExecutor createExecutor(AggregateMapper<?> mapper) { return new QueryExecutor(db, mapper, unitOfWork); }