From a5f01107977471decbb29acdff9c370006d5690c Mon Sep 17 00:00:00 2001 From: mvanzalu Date: Mon, 9 Sep 2024 10:16:27 +0000 Subject: [PATCH] test: assert correct max zip size --- .../org/icij/datashare/tasks/BatchDownloadRunnerTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datashare-app/src/test/java/org/icij/datashare/tasks/BatchDownloadRunnerTest.java b/datashare-app/src/test/java/org/icij/datashare/tasks/BatchDownloadRunnerTest.java index c5280b664..87a1408d5 100644 --- a/datashare-app/src/test/java/org/icij/datashare/tasks/BatchDownloadRunnerTest.java +++ b/datashare-app/src/test/java/org/icij/datashare/tasks/BatchDownloadRunnerTest.java @@ -66,11 +66,11 @@ public void test_max_zip_size() throws Exception { mockSearch.willReturn(2, documents); Task 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)