File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/test/java/com/fasterxml/jackson/databind/ser/jdk Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 6
6
import com .fasterxml .jackson .annotation .JsonFormat ;
7
7
8
8
import com .fasterxml .jackson .databind .*;
9
+ import com .fasterxml .jackson .databind .json .JsonMapper ;
9
10
10
11
public class UUIDSerializationTest extends BaseMapTest
11
12
{
@@ -73,9 +74,11 @@ public void testShapeOverrides() throws Exception
73
74
MAPPER .writeValueAsString (new UUIDWrapperVanilla (nullUUID )));
74
75
75
76
// but can also override by type
76
- ObjectMapper m = newJsonMapper ();
77
- m .configOverride (UUID .class )
78
- .setFormat (JsonFormat .Value .forShape (JsonFormat .Shape .BINARY ));
77
+ ObjectMapper m = JsonMapper .builder ()
78
+ .withConfigOverride (UUID .class ,
79
+ cfg -> cfg .setFormat (JsonFormat .Value .forShape (JsonFormat .Shape .BINARY ))
80
+ )
81
+ .build ();
79
82
assertEquals ("{\" uuid\" :\" AAAAAAAAAAAAAAAAAAAAAA==\" }" ,
80
83
m .writeValueAsString (new UUIDWrapperVanilla (nullUUID )));
81
84
}
You can’t perform that action at this time.
0 commit comments