Align with API changes in latest Spring Data Kay snapshots
See gh-7461
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user