From bf7e21e866e8f89af58a9b8a172bcc3c91d8bb62 Mon Sep 17 00:00:00 2001 From: John Blum Date: Tue, 13 Oct 2020 12:22:46 -0700 Subject: [PATCH] Fix test failure after Spring Boot upgraded from Jackson 2.11.2 to 2.11.3, which introduced an API (contractual) breaking change. Seems Jackson introduced an API breaking change that now requires a PolymorphicTypeValidator when configuring and activating the default typing as a propery on the ObjectMapper. --- .../json/JsonCacheDataImporterExporterIntegrationTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-geode/src/test/java/org/springframework/geode/data/json/JsonCacheDataImporterExporterIntegrationTests.java b/spring-geode/src/test/java/org/springframework/geode/data/json/JsonCacheDataImporterExporterIntegrationTests.java index 94e96699..cbd09248 100644 --- a/spring-geode/src/test/java/org/springframework/geode/data/json/JsonCacheDataImporterExporterIntegrationTests.java +++ b/spring-geode/src/test/java/org/springframework/geode/data/json/JsonCacheDataImporterExporterIntegrationTests.java @@ -40,6 +40,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.InvalidDefinitionException; import com.fasterxml.jackson.databind.exc.MismatchedInputException; +import com.fasterxml.jackson.databind.jsontype.DefaultBaseTypeLimitingValidator; import com.fasterxml.jackson.databind.node.ObjectNode; import org.junit.Before; @@ -623,7 +624,8 @@ public class JsonCacheDataImporterExporterIntegrationTests extends SpringApplica .identifiedAs(1L); ObjectMapper objectMapper = newObjectMapper() - .activateDefaultTypingAsProperty(null, ObjectMapper.DefaultTyping.EVERYTHING, "@type"); + .activateDefaultTypingAsProperty(new DefaultBaseTypeLimitingValidator(), + ObjectMapper.DefaultTyping.EVERYTHING, "@type"); String json = objectMapper.writeValueAsString(purchaseOrder);