@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);
    firstSearchWillReturn(MAX_BATCH_RESULT_SIZE/MAX_SCROLL_SIZE + 1, documents);
    when(repository.getQueued()).thenReturn(singletonList(
        new BatchSearch("uuid1", project("test-datashare"), "name", "desc", asSet("query"), new Date(), BatchSearch.State.RUNNING, User.local())
    ));
    assertThat(new BatchSearchRunner(indexer, repository, new PropertiesProvider(), local()).call()).isLessThan(60000);
}