From 4bf2cd07b3dcffeeb06db7cb3a07df81dcd28c84 Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Mon, 7 Jun 2021 15:25:04 +0800 Subject: [PATCH] refactor: extract mapper --- .../infrastructure/metadata/comicrack/dto/ComicInfoTest.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/komga/src/test/kotlin/org/gotson/komga/infrastructure/metadata/comicrack/dto/ComicInfoTest.kt b/komga/src/test/kotlin/org/gotson/komga/infrastructure/metadata/comicrack/dto/ComicInfoTest.kt index f71c439f..955fc641 100644 --- a/komga/src/test/kotlin/org/gotson/komga/infrastructure/metadata/comicrack/dto/ComicInfoTest.kt +++ b/komga/src/test/kotlin/org/gotson/komga/infrastructure/metadata/comicrack/dto/ComicInfoTest.kt @@ -8,10 +8,11 @@ import org.springframework.core.io.ClassPathResource class ComicInfoTest { + private val mapper = XmlMapper() + @Test fun `given valid xml file when deserializing then properties are available`() { val file = ClassPathResource("comicrack/ComicInfo.xml") - val mapper = XmlMapper() val comicInfo = mapper.readValue(file.url) with(comicInfo) { @@ -36,7 +37,6 @@ class ComicInfoTest { @Test fun `given another valid xml file when deserializing then properties are available`() { val file = ClassPathResource("comicrack/ComicInfo2.xml") - val mapper = XmlMapper() val comicInfo = mapper.readValue(file.url) with(comicInfo) { @@ -64,7 +64,6 @@ class ComicInfoTest { @Test fun `given incorrect enum values when deserializing then it is ignored`() { val file = ClassPathResource("comicrack/InvalidEnumValues.xml") - val mapper = XmlMapper() val comicInfo = mapper.readValue(file.url) with(comicInfo) {