1
1
package com.fasterxml.jackson.module.kotlin.test.github.failing
2
2
3
- import com.fasterxml.jackson.annotation.JsonInclude
4
3
import com.fasterxml.jackson.annotation.JsonProperty
5
- import com.fasterxml.jackson.databind.MapperFeature.SORT_PROPERTIES_ALPHABETICALLY
6
- import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
4
+ import com.fasterxml.jackson.databind.MapperFeature
5
+ import com.fasterxml.jackson.module.kotlin.jsonMapper
7
6
import org.junit.Ignore
8
7
import org.junit.Test
9
8
import kotlin.test.assertEquals
@@ -12,9 +11,12 @@ import kotlin.test.assertEquals
12
11
* Fields named "is…" are only serialized if they are Boolean
13
12
*/
14
13
class TestGitHub337 {
15
- private val mapper = jacksonObjectMapper()
16
- .setSerializationInclusion(JsonInclude .Include .ALWAYS )
17
- .configure(SORT_PROPERTIES_ALPHABETICALLY , true )
14
+ private val mapper = jsonMapper {
15
+ // enable(JsonInclude.Include.ALWAYS)
16
+ enable(MapperFeature .SORT_PROPERTIES_ALPHABETICALLY )
17
+ }
18
+ // .setSerializationInclusion(JsonInclude.Include.ALWAYS)
19
+ // .configure(SORT_PROPERTIES_ALPHABETICALLY, true)
18
20
private val writer = mapper.writerWithDefaultPrettyPrinter()
19
21
20
22
@Test
@@ -61,7 +63,7 @@ class TestGitHub337 {
61
63
val problematic = ClassWithIsFields (true , 9 )
62
64
val expected = """
63
65
{
64
- "isBooleanField " : true,
66
+ "booleanField " : true,
65
67
"isIntField" : 9
66
68
}""" .trimIndent()
67
69
assertEquals(expected, writer.writeValueAsString(problematic))
0 commit comments