Merge branch '2.1.x'
This commit is contained in:
@@ -84,7 +84,8 @@ public class GsonAutoConfiguration {
|
||||
.toCall(builder::generateNonExecutableJson);
|
||||
map.from(properties::getExcludeFieldsWithoutExposeAnnotation)
|
||||
.toCall(builder::excludeFieldsWithoutExposeAnnotation);
|
||||
map.from(properties::getSerializeNulls).toCall(builder::serializeNulls);
|
||||
map.from(properties::getSerializeNulls).whenTrue()
|
||||
.toCall(builder::serializeNulls);
|
||||
map.from(properties::getEnableComplexMapKeySerialization)
|
||||
.toCall(builder::enableComplexMapKeySerialization);
|
||||
map.from(properties::getDisableInnerClassSerialization)
|
||||
|
||||
@@ -80,7 +80,7 @@ public class GsonAutoConfigurationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void serializeNulls() {
|
||||
public void serializeNullsTrue() {
|
||||
this.contextRunner.withPropertyValues("spring.gson.serialize-nulls:true")
|
||||
.run((context) -> {
|
||||
Gson gson = context.getBean(Gson.class);
|
||||
@@ -88,6 +88,15 @@ public class GsonAutoConfigurationTests {
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void serializeNullsFalse() {
|
||||
this.contextRunner.withPropertyValues("spring.gson.serialize-nulls:false")
|
||||
.run((context) -> {
|
||||
Gson gson = context.getBean(Gson.class);
|
||||
assertThat(gson.serializeNulls()).isFalse();
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void enableComplexMapKeySerialization() {
|
||||
this.contextRunner
|
||||
|
||||
Reference in New Issue
Block a user