|
57 | 57 | import com.fasterxml.jackson.databind.SerializerProvider; |
58 | 58 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
59 | 59 | import com.fasterxml.jackson.databind.cfg.DeserializerFactoryConfig; |
| 60 | +import com.fasterxml.jackson.databind.cfg.EnumFeature; |
| 61 | +import com.fasterxml.jackson.databind.cfg.JsonNodeFeature; |
60 | 62 | import com.fasterxml.jackson.databind.cfg.SerializerFactoryConfig; |
61 | 63 | import com.fasterxml.jackson.databind.deser.BasicDeserializerFactory; |
62 | 64 | import com.fasterxml.jackson.databind.deser.Deserializers; |
@@ -478,10 +480,12 @@ void completeSetup() throws JsonMappingException { |
478 | 480 | .annotationIntrospector(current -> AnnotationIntrospector.pair(current, introspector)) |
479 | 481 | .featuresToEnable(SerializationFeature.FAIL_ON_EMPTY_BEANS, |
480 | 482 | DeserializationFeature.UNWRAP_ROOT_VALUE, |
| 483 | + EnumFeature.WRITE_ENUMS_TO_LOWERCASE, |
481 | 484 | JsonParser.Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER, |
482 | 485 | JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS) |
483 | 486 | .featuresToDisable(MapperFeature.AUTO_DETECT_GETTERS, |
484 | 487 | MapperFeature.AUTO_DETECT_FIELDS, |
| 488 | + JsonNodeFeature.READ_NULL_PROPERTIES, |
485 | 489 | JsonParser.Feature.AUTO_CLOSE_SOURCE, |
486 | 490 | JsonGenerator.Feature.QUOTE_FIELD_NAMES) |
487 | 491 | .serializationInclusion(JsonInclude.Include.NON_NULL); |
@@ -510,13 +514,15 @@ void completeSetup() throws JsonMappingException { |
510 | 514 |
|
511 | 515 | assertThat(mapper.getSerializationConfig().isEnabled(SerializationFeature.FAIL_ON_EMPTY_BEANS)).isTrue(); |
512 | 516 | assertThat(mapper.getDeserializationConfig().isEnabled(DeserializationFeature.UNWRAP_ROOT_VALUE)).isTrue(); |
| 517 | + assertThat(mapper.getSerializationConfig().isEnabled(EnumFeature.WRITE_ENUMS_TO_LOWERCASE)).isTrue(); |
513 | 518 | assertThat(mapper.getFactory().isEnabled(JsonParser.Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER)).isTrue(); |
514 | 519 | assertThat(mapper.getFactory().isEnabled(JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS)).isTrue(); |
515 | 520 |
|
516 | 521 | assertThat(mapper.getSerializationConfig().isEnabled(MapperFeature.AUTO_DETECT_GETTERS)).isFalse(); |
517 | 522 | assertThat(mapper.getDeserializationConfig().isEnabled(MapperFeature.DEFAULT_VIEW_INCLUSION)).isFalse(); |
518 | 523 | assertThat(mapper.getDeserializationConfig().isEnabled(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)).isFalse(); |
519 | 524 | assertThat(mapper.getDeserializationConfig().isEnabled(MapperFeature.AUTO_DETECT_FIELDS)).isFalse(); |
| 525 | + assertThat(mapper.getDeserializationConfig().isEnabled(JsonNodeFeature.READ_NULL_PROPERTIES)).isFalse(); |
520 | 526 | assertThat(mapper.getFactory().isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE)).isFalse(); |
521 | 527 | assertThat(mapper.getFactory().isEnabled(JsonGenerator.Feature.QUOTE_FIELD_NAMES)).isFalse(); |
522 | 528 | assertThat(mapper.getSerializationConfig().getSerializationInclusion()).isSameAs(JsonInclude.Include.NON_NULL); |
|
0 commit comments