BrowseAssetIterator extends ComponentSupport implements Iterator<ODocument> { boolean isHasBrowsedClass() { return hasBrowsedClass; } BrowseAssetIterator(final OrientContentAuthHelper contentAuthHelper,
                      final ODatabaseDocumentTx db,
                      @Nullable final String rid,
                      final String repositoryName,
                      final List<String> bucketIds,
                      final int limit,
                      final int pageSize); @Override boolean hasNext(); @Override ODocument next(); @Override String toString();  }
@Test public void testIteratorCount() { db = mockDbQuery(NEW_RID, 100, page(3, "#9:54"), page(3, "#9:54")); underTest = new BrowseAssetIterator(contentAuthHelper, db, NEW_RID, FOO, singletonList("#9:54"), 4, 100); assertThat(size((Iterable<ODocument>)() -> underTest), equalTo(4)); assertThat(underTest.isHasBrowsedClass(), is(false)); }
@Test public void testIteratorCountWithSkips() { db = mockDbQuery(NEW_RID, 100, page(2, "#9:51"), page(4, "#9:51"), page(6, "#9:51"), page(3, "#9:54"), page(7, "#9:51"), page(3, "#9:54"), page(3, "#9:54"), page(3, "#9:54")); underTest = new BrowseAssetIterator(contentAuthHelper, db, NEW_RID, FOO, singletonList("#9:54"), 10, 100); assertThat(size((Iterable<ODocument>)() -> underTest), equalTo(10)); assertThat(underTest.isHasBrowsedClass(), is(false)); }
@Test public void testQueryReturnsFewerThanLimitResults() { db = mockDbQuery(NEW_RID, 100, page(3, "#9:54"), page(3, "#9:51")); underTest = new BrowseAssetIterator(contentAuthHelper, db, NEW_RID, FOO, singletonList("#9:54"), 10, 100); assertThat(size((Iterable<ODocument>)() -> underTest), equalTo(3)); assertThat(underTest.isHasBrowsedClass(), is(false)); }