use of org.icij.datashare.tasks.BatchSearchRunner.MAX_BATCH_RESULT_SIZE in project datashare by ICIJ.
the class BatchSearchRunnerTest method test_run_batch_search_truncate_to_60k_max_results.
@Test
public void test_run_batch_search_truncate_to_60k_max_results() throws Exception {
Document[] documents = IntStream.range(0, MAX_SCROLL_SIZE).mapToObj(i -> createDoc("doc" + i).build()).toArray(Document[]::new);
mockSearch.willReturn(MAX_BATCH_RESULT_SIZE / MAX_SCROLL_SIZE + 1, documents);
BatchSearch batchSearch = new BatchSearch("uuid1", project("test-datashare"), "name", "desc", asSet("query"), new Date(), BatchSearch.State.QUEUED, local());
assertThat(new BatchSearchRunner(indexer, new PropertiesProvider(), batchSearch, resultConsumer).call()).isLessThan(60000);
}
Aggregations