File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
src/test/kotlin/tools/jackson/module/kotlin/test/github Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ package tools.jackson.module.kotlin.test.github
2+
3+ import com.fasterxml.jackson.annotation.JsonInclude
4+ import org.junit.jupiter.api.Assertions.assertDoesNotThrow
5+ import tools.jackson.module.kotlin.jacksonMapperBuilder
6+ import kotlin.test.Test
7+ import kotlin.test.assertEquals
8+
9+ class GitHub1065 {
10+ data class Vehicle (val id : VehicleId ? )
11+
12+ @JvmInline
13+ value class VehicleId (val value : String )
14+
15+ @Test
16+ fun test () {
17+ val mapper = jacksonMapperBuilder()
18+ .apply {
19+ changeDefaultPropertyInclusion { it.withValueInclusion(JsonInclude .Include .NON_EMPTY ) }
20+ }.build()
21+
22+ val dto = Vehicle (id = VehicleId (" vehicle-1" ))
23+
24+ assertDoesNotThrow {
25+ assertEquals(
26+ """ {"id":"vehicle-1"}""" ,
27+ mapper.writeValueAsString(dto)
28+ )
29+ }
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments