Skip to content

Commit d356278

Browse files
authored
Update PagerSpliteratorTest.java
1 parent fc44476 commit d356278

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/test/java/org/gitlab4j/api/PagerSpliteratorTest.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ public void shouldDoNotFailOnEmptySource() {
4646

4747
assertFalse(success);
4848
}
49+
50+
@Test
51+
public void shouldReturnFalseIfNextPagerItemMissing() {
52+
when(pager.hasNext()).thenReturn(true);
53+
when(pager.next()).thenReturn(Collections.emptyList());
54+
55+
boolean success = pagerSpliterator.tryAdvance(System.out::println);
56+
57+
assertFalse(success);
58+
}
4959

5060
@Test
5161
public void shouldThrowNullPointerExceptionWhenActionIsMissing() {
@@ -75,4 +85,4 @@ public void shouldAllowToGatherDataPageByPage() {
7585

7686
assertArrayEquals(new Integer[]{1, 2, 3, 4, 5}, elements);
7787
}
78-
}
88+
}

0 commit comments

Comments
 (0)