diff --git a/snapshot-matcher/pom.xml b/snapshot-matcher/pom.xml index b3e7491..d7ca30a 100644 --- a/snapshot-matcher/pom.xml +++ b/snapshot-matcher/pom.xml @@ -6,12 +6,12 @@ com.zenika snapshot-matcher - 1.0-SNAPSHOT + 1.1-SNAPSHOT jar 1.8 - 2.10.0 + 2.13.1 1.3.0 1.3 3.1 diff --git a/snapshot-matcher/snapshot-matcher.iml b/snapshot-matcher/snapshot-matcher.iml index 7b69d98..a2b20a4 100644 --- a/snapshot-matcher/snapshot-matcher.iml +++ b/snapshot-matcher/snapshot-matcher.iml @@ -13,13 +13,8 @@ - - - - - - - - + + + \ No newline at end of file diff --git a/snapshot-matcher/src/main/java/com/zenika/snapshotmatcher/DeterministicObjectMapper.java b/snapshot-matcher/src/main/java/com/zenika/snapshotmatcher/DeterministicObjectMapper.java index 6d790b8..99b5b3d 100644 --- a/snapshot-matcher/src/main/java/com/zenika/snapshotmatcher/DeterministicObjectMapper.java +++ b/snapshot-matcher/src/main/java/com/zenika/snapshotmatcher/DeterministicObjectMapper.java @@ -1,12 +1,12 @@ package com.zenika.snapshotmatcher; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.TreeNode; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.json.JsonMapper; import java.io.IOException; import java.io.Writer; @@ -29,10 +29,11 @@ class DeterministicObjectMapper { private final ObjectMapper objectMapper; DeterministicObjectMapper() { - objectMapper = new ObjectMapper() - .configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true) - .configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true) - .setSerializationInclusion(JsonInclude.Include.NON_NULL); + objectMapper = JsonMapper + .builder() + .configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true) + .configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true) + .build(); } public void writeValue(Writer writer, Object o) throws IOException {