File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
src/test/scala/com/fasterxml/jackson/module/scala/ser Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .fasterxml .jackson .module .scala .ser
2
+
3
+ import com .fasterxml .jackson .module .scala .DefaultScalaModule
4
+ import org .junit .runner .RunWith
5
+ import org .scalatestplus .junit .JUnitRunner
6
+
7
+ case object CaseObjectExample {
8
+ val field1 : String = " test"
9
+ val field2 : Int = 42
10
+ }
11
+
12
+ @ RunWith (classOf [JUnitRunner ])
13
+ class CaseObjectSerializerTest extends SerializerTest {
14
+
15
+ def module = DefaultScalaModule
16
+
17
+ " An ObjectMapper with the DefaultScalaModule" should " serialize a case object as a bean" in {
18
+ serialize(CaseObjectExample ) should (
19
+ equal (""" {"field1":"test","field2":42}""" ) or
20
+ equal (""" {"field2":42, field1":"test"}""" )
21
+ )
22
+ }
23
+ }
You can’t perform that action at this time.
0 commit comments