Skip to content

Commit fe93636

Browse files
author
PJ Fanning
committed
add test for #429 (broken with scala 2.13.x)
1 parent ed459e1 commit fe93636

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
}

0 commit comments

Comments
 (0)