@Test
public void verifyQueryEngineUsesPaginationInformation()
{

    Query query = Query.from( new OrganisationUnitSchemaDescriptor().getSchema() );
    query.setFirstResult( 100 );
    query.setMaxResults( 50 );
    // Here we make sure that the pagination info are actually passed to the
    // Hibernate query engine
    when( criteriaQueryEngine.query( argThat( new QueryWithPagination( query ) ) ) )
        .thenReturn( createOrgUnits( 20 ) );
    List<? extends IdentifiableObject> orgUnits = subject.query( query );
    assertThat( orgUnits.size(), is( 20 ) );
}