File tree 1 file changed +28
-0
lines changed
src/test/scala/com/fasterxml/jackson/module/scala/ser
1 file changed +28
-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
+ object ObjectSerializerTest {
8
+ trait TraitWithoutJsonProperty {
9
+ val name = " name1"
10
+ }
11
+ object ObjectWithoutJsonProperty extends TraitWithoutJsonProperty {
12
+ val value = " value1"
13
+ }
14
+ }
15
+
16
+ @ RunWith (classOf [JUnitRunner ])
17
+ class ObjectSerializerTest extends SerializerTest {
18
+
19
+ import ObjectSerializerTest ._
20
+ def module = DefaultScalaModule
21
+
22
+ " An ObjectMapper with the DefaultScalaModule" should " serialize an object as a bean" in {
23
+ serialize(ObjectWithoutJsonProperty ) should (
24
+ equal (""" {"name":"name1","value":"value1"}""" ) or
25
+ equal (""" {"value":"value1","name":"name1"}""" )
26
+ )
27
+ }
28
+ }
You can’t perform that action at this time.
0 commit comments