File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed
src/test/kotlin/tools/jackson/module/kotlin Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,12 @@ class KotlinModuleTest {
1313 // After the final migration is complete, this test will be removed.
1414 @Test
1515 fun strictNullChecksTests () {
16- assertTrue(kotlinModule { enable(StrictNullChecks ) }.strictNullChecks)
16+ assertTrue(
17+ kotlinModule {
18+ disable(NewStrictNullChecks )
19+ enable(StrictNullChecks )
20+ }.strictNullChecks
21+ )
1722 assertTrue(kotlinModule { enable(NewStrictNullChecks ) }.strictNullChecks)
1823
1924 assertThrows<IllegalArgumentException > {
@@ -32,8 +37,8 @@ class KotlinModuleTest {
3237 assertFalse(module.nullToEmptyCollection)
3338 assertFalse(module.nullToEmptyMap)
3439 assertFalse(module.nullIsSameAsDefault)
35- assertFalse (module.singletonSupport)
36- assertFalse (module.strictNullChecks)
40+ assertTrue (module.singletonSupport)
41+ assertTrue (module.strictNullChecks)
3742 assertFalse(module.kotlinPropertyNameAsImplicitName)
3843 assertFalse(module.useJavaDurationConversion)
3944 }
Original file line number Diff line number Diff line change @@ -9,12 +9,14 @@ import org.junit.jupiter.api.Assertions
99import org.junit.jupiter.api.Assertions.assertEquals
1010import org.junit.jupiter.api.Test
1111import tools.jackson.databind.DeserializationFeature
12+ import tools.jackson.module.kotlin.KotlinFeature
1213import kotlin.test.assertTrue
1314import kotlin.test.fail
1415
1516class TestGithub27 {
16- val mapper = jacksonMapperBuilder().disable(SerializationFeature .INDENT_OUTPUT )
17- .build()
17+ val mapper = jacksonMapperBuilder { disable(KotlinFeature .NewStrictNullChecks ) }
18+ .disable(SerializationFeature .INDENT_OUTPUT )
19+ .build()
1820
1921 private data class ClassWithNullableInt (val sample : Int? )
2022
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import tools.jackson.module.kotlin.readValue
88import tools.jackson.module.kotlin.test.expectFailure
99import kotlin.test.assertSame
1010import org.junit.jupiter.api.Test
11+ import tools.jackson.module.kotlin.KotlinFeature
1112
1213/* *
1314 * An empty object should be deserialized as *the* Unit instance for a nullable Unit reference Type.
@@ -30,7 +31,7 @@ class TestGithub518 {
3031 @Test
3132 fun deserializeEmptyObjectToSingletonUnitFails () {
3233 expectFailure<AssertionError >(" GitHub #518 has been fixed!" ) {
33- assertSame(jacksonObjectMapper() .readValue<Unit ?>(" {}" ), Unit )
34+ assertSame(jacksonObjectMapper { disable( SingletonSupport ) } .readValue<Unit ?>(" {}" ), Unit )
3435 }
3536 }
3637
You can’t perform that action at this time.
0 commit comments