File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/test/scala/tools/jackson/module/scala/deser Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package tools.jackson.module.scala.deser
2
2
3
3
import CaseObjectDeserializerTest .{Foo , TestObject }
4
4
import com .fasterxml .jackson .annotation .JsonAutoDetect
5
+ import tools .jackson .databind .DeserializationFeature
5
6
import tools .jackson .databind .introspect .VisibilityChecker
6
7
import tools .jackson .databind .json .JsonMapper
7
8
import tools .jackson .module .scala .{ClassTagExtensions , DefaultScalaModule }
@@ -29,6 +30,17 @@ class CaseObjectDeserializerTest extends DeserializerTest {
29
30
assert(deserialized === original)
30
31
}
31
32
33
+ it should " deserialize a case object and not create a new instance (FAIL_ON_TRAILING_TOKENS disabled)" in {
34
+ val mapper = newBuilder
35
+ .disable(DeserializationFeature .FAIL_ON_TRAILING_TOKENS )
36
+ .build()
37
+ val original = TestObject
38
+ val json = mapper.writeValueAsString(original)
39
+ json shouldEqual " {}"
40
+ val deserialized = mapper.readValue(json, TestObject .getClass)
41
+ assert(deserialized === original)
42
+ }
43
+
32
44
it should " deserialize Foo and not create a new instance" in {
33
45
val mapper = newMapper
34
46
val original = Foo
You can’t perform that action at this time.
0 commit comments