Revert "Upgrade to Jackson 2.9.0.pr1"

This reverts commit 10ae5e8f3f. Health
serialization fails with Jackson 2.9.0 (gh-7695).

See gh-8537
This commit is contained in:
Andy Wilkinson
2017-03-15 17:01:12 +00:00
parent 10ae5e8f3f
commit 1893fdab0d
4 changed files with 7 additions and 34 deletions

View File

@@ -22,7 +22,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.BeanDescription;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationConfig;
@@ -172,7 +171,7 @@ public class ConfigurationPropertiesReportEndpoint
*/
protected void configureObjectMapper(ObjectMapper mapper) {
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
mapper.setSerializationInclusion(Include.NON_NULL);
mapper.configure(SerializationFeature.WRITE_NULL_MAP_VALUES, false);
applyCglibFilters(mapper);
applySerializationModifier(mapper);
}

View File

@@ -61,18 +61,6 @@ public class ConfigurationPropertiesReportEndpointTests
assertThat(nestedProperties).isNotNull();
assertThat(nestedProperties.get("prefix")).isEqualTo("test");
assertThat(nestedProperties.get("properties")).isNotNull();
}
@Test
@SuppressWarnings("unchecked")
public void entriesWithNullValuesAreNotIncluded() {
ConfigurationPropertiesReportEndpoint report = getEndpointBean();
Map<String, Object> properties = report.invoke();
Map<String, Object> nestedProperties = (Map<String, Object>) properties
.get("testProperties");
assertThat((Map<String, Object>) nestedProperties.get("properties"))
.doesNotContainKey("nullValue");
}
@Test
@@ -286,8 +274,6 @@ public class ConfigurationPropertiesReportEndpointTests
private List<List<ListItem>> listOfListItems = new ArrayList<>();
private String nullValue = null;
public TestProperties() {
this.secrets.put("mine", "myPrivateThing");
this.secrets.put("yours", "yourPrivateThing");
@@ -351,14 +337,6 @@ public class ConfigurationPropertiesReportEndpointTests
this.listOfListItems = listOfListItems;
}
public String getNullValue() {
return this.nullValue;
}
public void setNullValue(String nullValue) {
this.nullValue = nullValue;
}
public static class Hidden {
private String mine = "mySecret";