Merge branch 'BAEL-20663' of https://github.com/kwoyke/tutorials into BAEL-20663

This commit is contained in:
Krzysztof Woyke 2020-01-10 15:25:40 +01:00
commit 44ddb2bcc4
3 changed files with 5 additions and 3 deletions

View File

@ -223,6 +223,8 @@
</profiles>
<properties>
<spring-boot.version>2.1.9.RELEASE</spring-boot.version>
<thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
<!-- persistence -->

View File

@ -15,7 +15,7 @@ public class StudentServiceImpl implements StudentService {
@Override
public Page<Student> findPaginated(int page, int size) {
return dao.findAll(new PageRequest(page, size));
return dao.findAll(PageRequest.of(page, size));
}
}

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());
}
}