Align with API changes in latest Spring Data Kay snapshots

See gh-7461
This commit is contained in:
Andy Wilkinson
2017-03-24 11:26:27 +00:00
parent 83df8e47fe
commit a9a31107cf
6 changed files with 21 additions and 11 deletions

View File

@@ -42,7 +42,7 @@ public class CityRepositoryIntegrationTests {
@Test
public void findsFirstPageOfCities() {
Page<City> cities = this.repository.findAll(new PageRequest(0, 10));
Page<City> cities = this.repository.findAll(PageRequest.of(0, 10));
assertThat(cities.getTotalElements()).isGreaterThan(20L);
}
}

View File

@@ -51,12 +51,11 @@ public class HotelRepositoryIntegrationTests {
@Test
public void executesQueryMethodsCorrectly() {
City city = this.cityRepository
.findAll(new PageRequest(0, 1, Direction.ASC, "name")).getContent()
.get(0);
.findAll(PageRequest.of(0, 1, Direction.ASC, "name")).getContent().get(0);
assertThat(city.getName()).isEqualTo("Atlanta");
Page<HotelSummary> hotels = this.repository.findByCity(city,
new PageRequest(0, 10, Direction.ASC, "name"));
PageRequest.of(0, 10, Direction.ASC, "name"));
Hotel hotel = this.repository.findByCityAndName(city,
hotels.getContent().get(0).getName());
assertThat(hotel.getName()).isEqualTo("Doubletree");