From 62c7c006d7b3a332a2a8c79b4412d9755aca5983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Kuchy=C5=88ka=20=28Anty=29?= Date: Fri, 10 Jan 2025 17:25:13 +0100 Subject: [PATCH] fix: lint --- .../io/tolgee/unit/util/exportAssertUtil.kt | 30 ++++++++++--------- .../unit/xlsx/out/XlsxFileExporterTest.kt | 23 +++++++++----- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/backend/data/src/test/kotlin/io/tolgee/unit/util/exportAssertUtil.kt b/backend/data/src/test/kotlin/io/tolgee/unit/util/exportAssertUtil.kt index 503c9950d8..6476a3fecd 100644 --- a/backend/data/src/test/kotlin/io/tolgee/unit/util/exportAssertUtil.kt +++ b/backend/data/src/test/kotlin/io/tolgee/unit/util/exportAssertUtil.kt @@ -19,19 +19,21 @@ fun getExported(exporter: FileExporter): Map { fun getExportedCompressed(exporter: FileExporter): Map { val files = exporter.produceFiles() - val data = files.map { - it.key to buildString { - val stream = ZipInputStream(it.value) - var entry = stream.nextEntry - while (entry != null) { - appendLine("====================") - appendLine(entry.name) - appendLine("--------------------") - append(stream.bufferedReader().readText()) - appendLine() - entry = stream.nextEntry - } - } - }.toMap() + val data = + files.map { + it.key to + buildString { + val stream = ZipInputStream(it.value) + var entry = stream.nextEntry + while (entry != null) { + appendLine("====================") + appendLine(entry.name) + appendLine("--------------------") + append(stream.bufferedReader().readText()) + appendLine() + entry = stream.nextEntry + } + } + }.toMap() return data } diff --git a/backend/data/src/test/kotlin/io/tolgee/unit/xlsx/out/XlsxFileExporterTest.kt b/backend/data/src/test/kotlin/io/tolgee/unit/xlsx/out/XlsxFileExporterTest.kt index fedc641b80..1f8ef130c6 100644 --- a/backend/data/src/test/kotlin/io/tolgee/unit/xlsx/out/XlsxFileExporterTest.kt +++ b/backend/data/src/test/kotlin/io/tolgee/unit/xlsx/out/XlsxFileExporterTest.kt @@ -15,7 +15,6 @@ import java.util.Calendar import java.util.Date class XlsxFileExporterTest { - private val currentDateProvider = Mockito.mock(CurrentDateProvider::class.java) @BeforeEach @@ -33,7 +32,9 @@ class XlsxFileExporterTest { fun `exports with placeholders (ICU placeholders disabled)`() { val exporter = getIcuPlaceholdersDisabledExporter() val data = getExportedCompressed(exporter) - data.assertFile("all.xlsx", """ + data.assertFile( + "all.xlsx", + """ |==================== |[Content_Types].xml |-------------------- @@ -77,7 +78,8 @@ class XlsxFileExporterTest { | |01234506 | - """.trimMargin()) + """.trimMargin(), + ) } private fun getIcuPlaceholdersDisabledExporter(): XlsxFileExporter { @@ -108,7 +110,9 @@ class XlsxFileExporterTest { fun `exports with placeholders (ICU placeholders enabled)`() { val exporter = getIcuPlaceholdersEnabledExporter() val data = getExportedCompressed(exporter) - data.assertFile("all.xlsx", """ + data.assertFile( + "all.xlsx", + """ |==================== |[Content_Types].xml |-------------------- @@ -151,14 +155,17 @@ class XlsxFileExporterTest { | |012345 | - """.trimMargin()) + """.trimMargin(), + ) } @Test fun `correct exports translation with colon`() { val exporter = getExporter(getTranslationWithColon()) val data = getExportedCompressed(exporter) - data.assertFile("all.xlsx", """ + data.assertFile( + "all.xlsx", + """ |==================== |[Content_Types].xml |-------------------- @@ -201,7 +208,8 @@ class XlsxFileExporterTest { | |0123 | - """.trimMargin()) + """.trimMargin(), + ) } private fun getTranslationWithColon(): MutableList { @@ -248,4 +256,3 @@ class XlsxFileExporterTest { ) } } -