File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
main/java/com/fasterxml/jackson/databind/json
test/java/com/fasterxml/jackson/databind Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ public static Builder builder(JsonFactory streamFactory) {
118
118
return new Builder (new JsonMapper (streamFactory ));
119
119
}
120
120
121
- public JsonMapper .Builder rebuild () {
121
+ public JsonMapper .Builder rebuild () {
122
122
// 09-Dec-2018, tatu: Not as good as what 3.0 has wrt immutability, but best approximation
123
123
// we have for 2.x
124
124
return new Builder (this .copy ());
Original file line number Diff line number Diff line change 12
12
import com .fasterxml .jackson .core .*;
13
13
import com .fasterxml .jackson .core .json .JsonWriteFeature ;
14
14
import com .fasterxml .jackson .core .util .MinimalPrettyPrinter ;
15
-
15
+ import com . fasterxml . jackson . databind . cfg . EnumFeature ;
16
16
import com .fasterxml .jackson .databind .introspect .JacksonAnnotationIntrospector ;
17
17
import com .fasterxml .jackson .databind .introspect .VisibilityChecker ;
18
18
import com .fasterxml .jackson .databind .json .JsonMapper ;
@@ -267,6 +267,27 @@ public void testAnnotationIntrospectorCopying()
267
267
m2 .getSerializationConfig ().getAnnotationIntrospector ().getClass ());
268
268
}
269
269
270
+ /*
271
+ /**********************************************************
272
+ /* Test methods, JsonMapper.rebuild()
273
+ /**********************************************************
274
+ */
275
+
276
+ @ Test
277
+ public void jsonMapperRebuildTest ()
278
+ {
279
+ JsonMapper m = JsonMapper .builder ().build ();
280
+ JsonMapper m2 = m .copy ();
281
+ assertNotSame (m , m2 );
282
+
283
+ JsonMapper m3 = m2 .rebuild ()
284
+ .propertyNamingStrategy (PropertyNamingStrategies .SNAKE_CASE )
285
+ .enable (MapperFeature .ACCEPT_CASE_INSENSITIVE_ENUMS )
286
+ .enable (EnumFeature .WRITE_ENUMS_TO_LOWERCASE )
287
+ .build ();
288
+ assertNotSame (m2 , m3 );
289
+ }
290
+
270
291
/*
271
292
/**********************************************************
272
293
/* Test methods, other
You can’t perform that action at this time.
0 commit comments