diff --git a/src/test/kotlin/com/fasterxml/jackson/module/kotlin/KotlinModuleTest.kt b/src/test/kotlin/com/fasterxml/jackson/module/kotlin/KotlinModuleTest.kt index fe2e07cd..6968c835 100644 --- a/src/test/kotlin/com/fasterxml/jackson/module/kotlin/KotlinModuleTest.kt +++ b/src/test/kotlin/com/fasterxml/jackson/module/kotlin/KotlinModuleTest.kt @@ -11,6 +11,7 @@ import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue import org.junit.Test +import kotlin.test.assertNotNull class KotlinModuleTest { /** @@ -103,4 +104,27 @@ class KotlinModuleTest { assertTrue(module.strictNullChecks) } + + @Test + fun jdkSerializabilityTest() { + val module = KotlinModule.Builder().apply { + withReflectionCacheSize(123) + enable(NullToEmptyCollection) + enable(NullToEmptyMap) + enable(NullIsSameAsDefault) + enable(SingletonSupport) + enable(StrictNullChecks) + }.build() + + val serialized = jdkSerialize(module) + val deserialized = jdkDeserialize(serialized) + + assertNotNull(deserialized) + assertEquals(123, deserialized.reflectionCacheSize) + assertTrue(deserialized.nullToEmptyCollection) + assertTrue(deserialized.nullToEmptyMap) + assertTrue(deserialized.nullIsSameAsDefault) + assertEquals(CANONICALIZE, deserialized.singletonSupport) + assertTrue(deserialized.strictNullChecks) + } }