#504 - Fixing deprecation warnings in JPA and REST examples.
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -62,7 +62,7 @@ public class StoreRepositoryIntegrationTests {
|
||||
store = repository.save(store);
|
||||
|
||||
Page<Store> stores = repository.findByAddressLocationNear(location, new Distance(1.0, Metrics.KILOMETERS),
|
||||
new PageRequest(0, 10));
|
||||
PageRequest.of(0, 10));
|
||||
|
||||
assertThat(stores.getContent(), hasSize(1));
|
||||
assertThat(stores.getContent(), hasItem(store));
|
||||
|
||||
Reference in New Issue
Block a user