File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
src/test/kotlin/com/fasterxml/jackson/module/kotlin Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import org.junit.Assert.assertEquals
11
11
import org.junit.Assert.assertFalse
12
12
import org.junit.Assert.assertTrue
13
13
import org.junit.Test
14
+ import kotlin.test.assertNotNull
14
15
15
16
class KotlinModuleTest {
16
17
/* *
@@ -103,4 +104,27 @@ class KotlinModuleTest {
103
104
104
105
assertTrue(module.strictNullChecks)
105
106
}
107
+
108
+ @Test
109
+ fun jdkSerializabilityTest () {
110
+ val module = KotlinModule .Builder ().apply {
111
+ withReflectionCacheSize(123 )
112
+ enable(NullToEmptyCollection )
113
+ enable(NullToEmptyMap )
114
+ enable(NullIsSameAsDefault )
115
+ enable(SingletonSupport )
116
+ enable(StrictNullChecks )
117
+ }.build()
118
+
119
+ val serialized = jdkSerialize(module)
120
+ val deserialized = jdkDeserialize<KotlinModule >(serialized)
121
+
122
+ assertNotNull(deserialized)
123
+ assertEquals(123 , deserialized.reflectionCacheSize)
124
+ assertTrue(deserialized.nullToEmptyCollection)
125
+ assertTrue(deserialized.nullToEmptyMap)
126
+ assertTrue(deserialized.nullIsSameAsDefault)
127
+ assertEquals(CANONICALIZE , deserialized.singletonSupport)
128
+ assertTrue(deserialized.strictNullChecks)
129
+ }
106
130
}
You can’t perform that action at this time.
0 commit comments