Skip to content

Commit

Permalink
adds test at document page
Browse files Browse the repository at this point in the history
  • Loading branch information
otaviojava committed Aug 24, 2019
1 parent 6eecc8b commit 8318ec2
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import javax.enterprise.inject.Instance;
import javax.inject.Inject;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
Expand Down Expand Up @@ -154,6 +155,18 @@ public void shouldCreateCollectionFromCollectionFactory() {
assertEquals(1, people.size());
}

@Test
public void shouldRequestPageTwice() {
Pagination pagination = Pagination.page(1).size(1);
Page<Person> page = createPage(pagination);

List<Person> people = page.getContent().collect(Collectors.toList());
assertEquals(1, people.size());
assertEquals(0L, people.get(0).getId());
assertNotNull(page.getContent(ArrayList::new));
assertNotNull(page.getContent(HashSet::new));
}

@Test
public void shouldCreatePagination() {
Pagination pagination = Pagination.page(1).size(1);
Expand Down

0 comments on commit 8318ec2

Please sign in to comment.