Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
eddumelendez committed Oct 14, 2023
1 parent 2e301f3 commit 7b47cb8
Showing 1 changed file with 13 additions and 10 deletions.
Expand Up @@ -294,20 +294,23 @@ void defaultObjectMapperBuilder() {

@Test
void enableEnumFeature() {
this.contextRunner.withPropertyValues("spring.jackson.enum-data-type.write_enums_to_lowercase:true").run((context) -> {
ObjectMapper mapper = context.getBean(ObjectMapper.class);
assertThat(EnumFeature.WRITE_ENUMS_TO_LOWERCASE.enabledByDefault()).isFalse();
assertThat(mapper.getSerializationConfig().isEnabled(EnumFeature.WRITE_ENUMS_TO_LOWERCASE)).isTrue();
});
this.contextRunner.withPropertyValues("spring.jackson.enum-data-type.write_enums_to_lowercase:true")
.run((context) -> {
ObjectMapper mapper = context.getBean(ObjectMapper.class);
assertThat(EnumFeature.WRITE_ENUMS_TO_LOWERCASE.enabledByDefault()).isFalse();
assertThat(mapper.getSerializationConfig().isEnabled(EnumFeature.WRITE_ENUMS_TO_LOWERCASE)).isTrue();
});
}

@Test
void disableJsonNodeFeature() {
this.contextRunner.withPropertyValues("spring.jackson.json-node-data-type.write_null_properties:false").run((context) -> {
ObjectMapper mapper = context.getBean(ObjectMapper.class);
assertThat(JsonNodeFeature.WRITE_NULL_PROPERTIES.enabledByDefault()).isTrue();
assertThat(mapper.getDeserializationConfig().isEnabled(JsonNodeFeature.WRITE_NULL_PROPERTIES)).isFalse();
});
this.contextRunner.withPropertyValues("spring.jackson.json-node-data-type.write_null_properties:false")
.run((context) -> {
ObjectMapper mapper = context.getBean(ObjectMapper.class);
assertThat(JsonNodeFeature.WRITE_NULL_PROPERTIES.enabledByDefault()).isTrue();
assertThat(mapper.getDeserializationConfig().isEnabled(JsonNodeFeature.WRITE_NULL_PROPERTIES))
.isFalse();
});
}

@Test
Expand Down

0 comments on commit 7b47cb8

Please sign in to comment.