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 {
13
13
// After the final migration is complete, this test will be removed.
14
14
@Test
15
15
fun strictNullChecksTests () {
16
- assertTrue(kotlinModule { enable(StrictNullChecks ) }.strictNullChecks)
16
+ assertTrue(
17
+ kotlinModule {
18
+ disable(NewStrictNullChecks )
19
+ enable(StrictNullChecks )
20
+ }.strictNullChecks
21
+ )
17
22
assertTrue(kotlinModule { enable(NewStrictNullChecks ) }.strictNullChecks)
18
23
19
24
assertThrows<IllegalArgumentException > {
@@ -32,8 +37,8 @@ class KotlinModuleTest {
32
37
assertFalse(module.nullToEmptyCollection)
33
38
assertFalse(module.nullToEmptyMap)
34
39
assertFalse(module.nullIsSameAsDefault)
35
- assertFalse (module.singletonSupport)
36
- assertFalse (module.strictNullChecks)
40
+ assertTrue (module.singletonSupport)
41
+ assertTrue (module.strictNullChecks)
37
42
assertFalse(module.kotlinPropertyNameAsImplicitName)
38
43
assertFalse(module.useJavaDurationConversion)
39
44
}
Original file line number Diff line number Diff line change @@ -9,12 +9,14 @@ import org.junit.jupiter.api.Assertions
9
9
import org.junit.jupiter.api.Assertions.assertEquals
10
10
import org.junit.jupiter.api.Test
11
11
import tools.jackson.databind.DeserializationFeature
12
+ import tools.jackson.module.kotlin.KotlinFeature
12
13
import kotlin.test.assertTrue
13
14
import kotlin.test.fail
14
15
15
16
class 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()
18
20
19
21
private data class ClassWithNullableInt (val sample : Int? )
20
22
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import tools.jackson.module.kotlin.readValue
8
8
import tools.jackson.module.kotlin.test.expectFailure
9
9
import kotlin.test.assertSame
10
10
import org.junit.jupiter.api.Test
11
+ import tools.jackson.module.kotlin.KotlinFeature
11
12
12
13
/* *
13
14
* An empty object should be deserialized as *the* Unit instance for a nullable Unit reference Type.
@@ -30,7 +31,7 @@ class TestGithub518 {
30
31
@Test
31
32
fun deserializeEmptyObjectToSingletonUnitFails () {
32
33
expectFailure<AssertionError >(" GitHub #518 has been fixed!" ) {
33
- assertSame(jacksonObjectMapper() .readValue<Unit ?>(" {}" ), Unit )
34
+ assertSame(jacksonObjectMapper { disable( SingletonSupport ) } .readValue<Unit ?>(" {}" ), Unit )
34
35
}
35
36
}
36
37
You can’t perform that action at this time.
0 commit comments