Skip to content

Commit

Permalink
fix: behaviour of next link
Browse files Browse the repository at this point in the history
  • Loading branch information
mebo4b committed Nov 20, 2020
1 parent 433c639 commit 2d1750f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private HalLink buildNextLink() {
}

private boolean hasNextPage() {
return nonNull(this.resultPage) && this.resultPage.getTotalPages() > (this.page - 1);
return nonNull(this.resultPage) && this.resultPage.getTotalPages() > this.page;
}

private HalLink buildPreviousLink() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void build_Should_returnSessionAdminResultDTOWithoutNextLink_When_paramet
when(this.resultPage.getTotalPages()).thenReturn(MOCKED_SESSIONS_SIZE / 2);

SessionAdminResultDTO resultDTO = SessionAdminResultDTOBuilder.getInstance()
.withPage(11)
.withPage(10)
.withPerPage(2)
.withResultPage(this.resultPage)
.build();
Expand Down

0 comments on commit 2d1750f

Please sign in to comment.