BAEL-20663: Replace depracated PageRequest constructor with a static method
This commit is contained in:
parent
f373c922dd
commit
c46beaa211
@ -82,7 +82,7 @@ public class SpringDataWithSecurityIntegrationTest {
|
|||||||
.setAuthentication(auth);
|
.setAuthentication(auth);
|
||||||
Page<Tweet> page = null;
|
Page<Tweet> page = null;
|
||||||
do {
|
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()) {
|
for (Tweet twt : page.getContent()) {
|
||||||
isTrue((twt.getOwner() == appUser.getUsername()) || (twt.getLikes()
|
isTrue((twt.getOwner() == appUser.getUsername()) || (twt.getLikes()
|
||||||
.contains(appUser.getUsername())), "I do not have any Tweets");
|
.contains(appUser.getUsername())), "I do not have any Tweets");
|
||||||
@ -94,7 +94,7 @@ public class SpringDataWithSecurityIntegrationTest {
|
|||||||
public void givenNoAppUser_whenPaginatedResultsRetrievalAttempted_shouldFail() {
|
public void givenNoAppUser_whenPaginatedResultsRetrievalAttempted_shouldFail() {
|
||||||
Page<Tweet> page = null;
|
Page<Tweet> page = null;
|
||||||
do {
|
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());
|
} while (page != null && page.hasNext());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user