DuraStoreStitchingRetrievalSource extends DuraStoreRetrievalSource { @Override public synchronized ContentItem getNextContentItem() { log.debug("enter getNextContentItem()"); ContentItem item = super.getNextContentItem(); if (null != item && chunkUtil.isChunk(item.getContentId())) { log.debug("skipping chunk item: {}", item); item = getNextContentItem(); } log.debug("returning item: {}", item); return item; } DuraStoreStitchingRetrievalSource(ContentStore store,
                                             List<String> spaces,
                                             boolean allSpaces); @Override synchronized ContentItem getNextContentItem(); @Override String getSourceChecksum(ContentItem contentItem);  }
@Test public void testGetNextContentItem() throws Exception { List<ContentType> types0 = new ArrayList<ContentType>(); types0.add(BASIC); types0.add(BASIC); types0.add(MANIFEST); types0.add(CHUNK); types0.add(BASIC); types0.add(CHUNK); types0.add(BASIC); List<ContentType> types1 = new ArrayList<ContentType>(); types1.add(MANIFEST); types1.add(BASIC); types1.add(BASIC); types1.add(CHUNK); types1.add(CHUNK); types1.add(BASIC); types1.add(BASIC); createGetNextContentItemMocks(types0, types1); replayMocks(); retrievalSource = new DuraStoreStitchingRetrievalSource(store, spaces, allSpaces); verifyContents(types0, spaceId0); verifyContents(types1, spaceId1); ContentItem item = retrievalSource.getNextContentItem(); Assert.assertNull(item); }