}
@Test
public void shouldAllowSortingByAllPrimaryKeyColumns() throws Exception {
//given
repository.save(new BoardingPass("FOO-100", 1, "Smith", "B01"));
repository.save(new BoardingPass("FOO-100", 2, "Johnson", "C02"));
repository.save(new BoardingPass("BAR-100", 2, "Who", "E04"));
repository.save(new BoardingPass("BAR-100", 1, "Gordon", "D03"));
//when
final List<BoardingPass> all = repository.findAll(
new Sort(
new Order(ASC, "flight_no"),
new Order(DESC, "seq_no")
)
);
//then
assertThat(all).containsExactly(
new BoardingPass("BAR-100", 2, "Who", "E04"),
new BoardingPass("BAR-100", 1, "Gordon", "D03"),
new BoardingPass("FOO-100", 2, "Johnson", "C02"),
new BoardingPass("FOO-100", 1, "Smith", "B01")
);
}