use of org.icij.datashare.batch.BatchDownload in project datashare by ICIJ.
the class BatchDownloadRunnerTest method test_max_default_results.
@Test
public void test_max_default_results() throws Exception {
Document[] documents = IntStream.range(0, 3).mapToObj(i -> createDoc("doc" + i).with(createFile(i)).build()).toArray(Document[]::new);
mockSearch.willReturn(2, documents);
File zip = new BatchDownloadRunner(indexer, new PropertiesProvider(new HashMap<String, String>() {
{
put(BATCH_DOWNLOAD_MAX_NB_FILES, "3");
put(SCROLL_SIZE, "3");
}
}), new BatchDownload(project("test-datashare"), User.local(), "query"), updater).call();
assertThat(new ZipFile(zip).size()).isEqualTo(3);
}
Aggregations