Skip to content

Commit

Permalink
test: create nosql page scenario
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <[email protected]>
  • Loading branch information
otaviojava committed Aug 30, 2024
1 parent 931e258 commit de7c8f8
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,24 @@ void shouldReturnUnsupportedOperation() {
@Test
void shouldReturnTrueHasNext(){
Page<Person> page = NoSQLPage.of(Collections.singletonList(Person.builder().withName("Otavio").build()),
PageRequest.ofPage(2));
PageRequest.ofPage(2).size(1));

org.assertj.core.api.Assertions.assertThat(page.hasNext()).isTrue();
}

@Test
void shouldReturnFalseHasNextWhenIsEmpty(){
var page = NoSQLPage.of(Collections.emptyList(), PageRequest.ofPage(2).size(1));
org.assertj.core.api.Assertions.assertThat(page.hasNext()).isFalse();
}

@Test
void shouldReturnFalseHasNextWhenElementHasLessThanSize(){
var page = NoSQLPage.of(Collections.singletonList(Person.builder().withName("Otavio").build()),
PageRequest.ofPage(2).size(2));
org.assertj.core.api.Assertions.assertThat(page.hasNext()).isFalse();
}

@Test
void shouldReturnTrueHasPrevious(){
Page<Person> page = NoSQLPage.of(Collections.singletonList(Person.builder().withName("Otavio").build()),
Expand Down

0 comments on commit de7c8f8

Please sign in to comment.