#504 - Fixing deprecation warnings in JPA and REST examples.

This commit is contained in:
Oliver Drotbohm
2019-06-07 09:30:43 +02:00
parent 46c84687dd
commit f6245580c0
2 changed files with 3 additions and 3 deletions

View File

@@ -171,12 +171,12 @@ public class SimpleUserRepositoryTests {
// we deliberately save the items in reverse
repository.saveAll(Arrays.asList(user2, user1, user0));
List<User> resultAsc = repository.findTop2By(new Sort(ASC, "lastname"));
List<User> resultAsc = repository.findTop2By(Sort.by(ASC, "lastname"));
assertThat(resultAsc.size(), is(2));
assertThat(resultAsc, hasItems(user0, user1));
List<User> resultDesc = repository.findTop2By(new Sort(DESC, "lastname"));
List<User> resultDesc = repository.findTop2By(Sort.by(DESC, "lastname"));
assertThat(resultDesc.size(), is(2));
assertThat(resultDesc, hasItems(user1, user2));