public void testOrderByDescending() { final List<SimpleObject> objects = shillelagh.selectFrom(SimpleObject.class).orderBy("customerId").descending().toList(); int last = Integer.MAX_VALUE; for (final SimpleObject simpleObject : objects) { assertThat(simpleObject.getCustomerId()).isLessThanOrEqualTo(last); last = (int) simpleObject.getCustomerId(); } }
public void testOrderByAscending() { final List<SimpleObject> objects = shillelagh.selectFrom(SimpleObject.class).orderBy("customerId").ascending().toList(); int last = 0; for (final SimpleObject simpleObject : objects) { assertThat(simpleObject.getCustomerId()).isGreaterThanOrEqualTo(last); last = (int) simpleObject.getCustomerId(); } }