Skip to content

Commit

Permalink
Merge pull request #253 from ProjectMapK/update-jackson
Browse files Browse the repository at this point in the history
Update jackson version
  • Loading branch information
k163377 authored Nov 29, 2024
2 parents 4e59b5d + f4a29e2 commit 75cdf65
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
kotlin = "1.9.25" # Mainly for CI, it can be rewritten by environment variable.
jackson = "2.18.1"
jackson = "2.18.2"

# test libs
junit = "5.11.3"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package io.github.projectmapk.jackson.module.kogera.zPorted.test.github

import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.databind.ObjectMapper
import io.github.projectmapk.jackson.module.kogera.readValue
import io.github.projectmapk.jackson.module.kogera.registerKotlinModule
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test

class GitHub841 {
object Foo {
override fun toString(): String = "Foo()"

@JvmStatic
@JsonCreator
fun deserialize(): Foo {
return Foo
}
}

private val mapper = ObjectMapper()
.setSerializationInclusion(JsonInclude.Include.NON_ABSENT)
.registerKotlinModule()

@Test
fun shouldDeserializeSimpleObject() {
val value = Foo
val serialized = mapper.writeValueAsString(value)
val deserialized = mapper.readValue<Foo>(serialized)

assertEquals(value, deserialized)
}
}

0 comments on commit 75cdf65

Please sign in to comment.