Skip to content

Commit

Permalink
test: assert correct max zip size
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanzalu committed Sep 9, 2024
1 parent d63a40d commit a5f0110
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ public void test_max_zip_size() throws Exception {
mockSearch.willReturn(2, documents);
Task<File> taskView = getTaskView(new BatchDownload(singletonList(project("test-datashare")), User.local(), "query"));
UriResult result = new BatchDownloadRunner(indexer, new PropertiesProvider(new HashMap<>() {{
put(BATCH_DOWNLOAD_MAX_SIZE_OPT, valueOf("hello world 1".getBytes(StandardCharsets.UTF_8).length * 3));
put(BATCH_DOWNLOAD_MAX_SIZE_OPT, valueOf("hello world 1".getBytes(StandardCharsets.UTF_8).length * 3 - 1)); // to avoid adding the 4th doc
put(SCROLL_SIZE_OPT, "3");
}}), taskView, taskView.progress(updater::progress)).call();

assertThat(new ZipFile(new File(result.uri)).size()).isEqualTo(4);
assertThat(new ZipFile(new File(result.uri)).size()).isEqualTo(3); // the 4th doc must have been skipped
}

@Test(expected = ElasticsearchException.class)
Expand Down

0 comments on commit a5f0110

Please sign in to comment.