Skip to content

Commit 2452c3d

Browse files
committed
Drop is from boolean field
1 parent 141f7c8 commit 2452c3d

File tree

1 file changed

+9
-7
lines changed
  • src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/github/failing

1 file changed

+9
-7
lines changed

src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/github/failing/GitHub337.kt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package com.fasterxml.jackson.module.kotlin.test.github.failing
22

3-
import com.fasterxml.jackson.annotation.JsonInclude
43
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
76
import org.junit.Ignore
87
import org.junit.Test
98
import kotlin.test.assertEquals
@@ -12,9 +11,12 @@ import kotlin.test.assertEquals
1211
* Fields named "is…" are only serialized if they are Boolean
1312
*/
1413
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)
1820
private val writer = mapper.writerWithDefaultPrettyPrinter()
1921

2022
@Test
@@ -61,7 +63,7 @@ class TestGitHub337 {
6163
val problematic = ClassWithIsFields(true, 9)
6264
val expected = """
6365
{
64-
"isBooleanField" : true,
66+
"booleanField" : true,
6567
"isIntField" : 9
6668
}""".trimIndent()
6769
assertEquals(expected, writer.writeValueAsString(problematic))

0 commit comments

Comments
 (0)