diff --git a/config-data-executor/src/main/java/org/micord/service/DownloadService.java b/config-data-executor/src/main/java/org/micord/service/DownloadService.java index 39a44bb..588d5bd 100644 --- a/config-data-executor/src/main/java/org/micord/service/DownloadService.java +++ b/config-data-executor/src/main/java/org/micord/service/DownloadService.java @@ -327,7 +327,7 @@ public class DownloadService { return results; } - public File writeResultsToCsv(List> results, int limit) { + private File writeResultsToCsv(List> results, int limit) { try { // If results fit in a single file, create one CSV if (results.size() <= limit) { diff --git a/config-data-executor/src/test/java/org/micord/service/DownloadServiceTest.java b/config-data-executor/src/test/java/org/micord/service/DownloadServiceTest.java index 518f65b..e16784c 100644 --- a/config-data-executor/src/test/java/org/micord/service/DownloadServiceTest.java +++ b/config-data-executor/src/test/java/org/micord/service/DownloadServiceTest.java @@ -195,27 +195,6 @@ class DownloadServiceTest { assertThat(lines).hasSize(50000); } - @Test - void testSqlResultsChunking() throws Exception { - // Given: SQL results that will create exactly 2 chunks - // generateSqlTestData(1199999) creates 1 header + 1,199,998 data rows = 1,199,999 total - // With MAX_ROWS_PER_CSV = 600,000: - // File 1: header + 599,999 data rows = 600,000 total - // File 2: header + 599,999 data rows = 600,000 total - List sqlResults = generateSqlTestData(1199999); - - // When: Writing SQL results with chunking - File result = invokeWriteSqlResultsToZip(sqlResults); - - // Then: Should create ZIP with 2 CSV files - assertThat(result).isNotNull(); - assertThat(result.getName()).endsWith(".zip"); - - try (ZipFile zipFile = new ZipFile(result)) { - assertThat(Collections.list(zipFile.entries())).hasSize(2); - } - } - @Test void testZipFileContentsIntegrity() throws Exception { // Given: Large dataset @@ -280,11 +259,4 @@ class DownloadServiceTest { method.setAccessible(true); return (File) method.invoke(downloadService, results, prefix, suffix); } - - private File invokeWriteSqlResultsToZip(List results) throws Exception { - java.lang.reflect.Method method = DownloadService.class.getDeclaredMethod( - "writeSqlResultsToZip", List.class); - method.setAccessible(true); - return (File) method.invoke(downloadService, results); - } } \ No newline at end of file