mirror of
https://github.com/gotson/komga.git
synced 2026-05-09 05:10:19 +02:00
refactor: extract mapper
This commit is contained in:
parent
80e4d39a0d
commit
4bf2cd07b3
1 changed files with 2 additions and 3 deletions
|
|
@ -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<ComicInfo>(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<ComicInfo>(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<ComicInfo>(file.url)
|
||||
|
||||
with(comicInfo) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue