BAEL-20663: Replace depracated PageRequest constructor with a static method

This commit is contained in:
Krzysiek 2020-01-09 23:26:54 +01:00
parent f373c922dd
commit c46beaa211
1 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ public class SpringDataWithSecurityIntegrationTest {
.setAuthentication(auth);
Page<Tweet> page = null;
do {
page = tweetRepository.getMyTweetsAndTheOnesILiked(new PageRequest(page != null ? page.getNumber() + 1 : 0, 5));
page = tweetRepository.getMyTweetsAndTheOnesILiked(PageRequest.of(page != null ? page.getNumber() + 1 : 0, 5));
for (Tweet twt : page.getContent()) {
isTrue((twt.getOwner() == appUser.getUsername()) || (twt.getLikes()
.contains(appUser.getUsername())), "I do not have any Tweets");
@ -94,7 +94,7 @@ public class SpringDataWithSecurityIntegrationTest {
public void givenNoAppUser_whenPaginatedResultsRetrievalAttempted_shouldFail() {
Page<Tweet> page = null;
do {
page = tweetRepository.getMyTweetsAndTheOnesILiked(new PageRequest(page != null ? page.getNumber() + 1 : 0, 5));
page = tweetRepository.getMyTweetsAndTheOnesILiked(PageRequest.of(page != null ? page.getNumber() + 1 : 0, 5));
} while (page != null && page.hasNext());
}
}