File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/test/scala/tools/jackson/module/scala/deser Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 11package tools .jackson .module .scala .deser
22
3- import tools .jackson .module .scala .{ClassTagExtensions , DefaultScalaModule }
43import CaseObjectDeserializerTest .{Foo , TestObject }
54import com .fasterxml .jackson .annotation .JsonAutoDetect
65import tools .jackson .databind .introspect .VisibilityChecker
6+ import tools .jackson .databind .json .JsonMapper
7+ import tools .jackson .module .scala .{ClassTagExtensions , DefaultScalaModule }
8+ import tools .jackson .module .scala .introspect .ScalaAnnotationIntrospectorModule
79
810import scala .compat .java8 .FunctionConverters .asJavaUnaryOperator
911
@@ -56,4 +58,12 @@ class CaseObjectDeserializerTest extends DeserializerTest {
5658 assert(deserialized == original)
5759 }
5860
61+ " An ObjectMapper without ScalaObjectDeserializerModule" should " deserialize a case object but create a new instance" in {
62+ val mapper = JsonMapper .builder().addModule(ScalaAnnotationIntrospectorModule ).build()
63+ val original = TestObject
64+ val json = mapper.writeValueAsString(original)
65+ val deserialized = mapper.readValue(json, TestObject .getClass)
66+ assert(deserialized != original)
67+ }
68+
5969}
You can’t perform that action at this time.
0 commit comments