}
};
scopedFilters.add(new ScopedFilter(new AndCondition(getFilterResolver(),
fromCondition, untilCondition), Scope.Query));
DatabaseQuery result = underTest.buildQuery(scopedFilters, START, LENGTH);
assertThat(result.getQuery(), is("SELECT i.* FROM item i WHERE i.in_archive=true AND ((i.last_modified >= ?) AND (i.last_modified <= ?)) ORDER BY i.item_id OFFSET ? LIMIT ?"));
assertThat(((java.sql.Date)result.getParameters().get(0)).getTime(), is(fromDate(DATE).getTime()));
assertThat(((java.sql.Date)result.getParameters().get(1)).getTime(), is(untilDate(DATE).getTime()));
assertThat((Integer) result.getParameters().get(2), is(START));
assertThat((Integer) result.getParameters().get(3), is(LENGTH));
}