From 2b11dc919b6360aef02e14cc228c795efe0a454c Mon Sep 17 00:00:00 2001 From: Roman Szturc Date: Mon, 14 Oct 2024 13:11:42 +0200 Subject: [PATCH] Orizaba is default Eiffel protocol --- pom.xml | 4 ++-- .../publish/service/EventTemplateHandler.java | 23 +++++++++++-------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 3f7f473c..166bf550 100644 --- a/pom.xml +++ b/pom.xml @@ -9,8 +9,8 @@ 2.0.12 - 2.1.4 - 2.3.0 + 2.1.5 + 2.4.0 eiffel-remrem-publish ${eiffel-remrem-publish.version} diff --git a/publish-common/src/main/java/com/ericsson/eiffel/remrem/publish/service/EventTemplateHandler.java b/publish-common/src/main/java/com/ericsson/eiffel/remrem/publish/service/EventTemplateHandler.java index 6bc3006d..cac44a0d 100644 --- a/publish-common/src/main/java/com/ericsson/eiffel/remrem/publish/service/EventTemplateHandler.java +++ b/publish-common/src/main/java/com/ericsson/eiffel/remrem/publish/service/EventTemplateHandler.java @@ -18,9 +18,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.cfg.JsonNodeFeature; +import com.fasterxml.jackson.databind.json.JsonMapper; import com.jayway.jsonpath.Configuration; import com.jayway.jsonpath.JsonPath; import com.jayway.jsonpath.spi.json.JacksonJsonNodeJsonProvider; @@ -44,19 +48,20 @@ public class EventTemplateHandler { private static final String REGEXP_END_DIGITS = "\\[\\d+\\]$"; - private final Configuration configuration = Configuration.builder() - .jsonProvider(new JacksonJsonNodeJsonProvider()) - .mappingProvider(new JacksonMappingProvider()) - .build(); + private ObjectMapper mapper = JsonMapper.builder() + .disable(JsonNodeFeature.READ_NULL_PROPERTIES) + .build() + .setSerializationInclusion(JsonInclude.Include.NON_EMPTY); + private Configuration configuration = Configuration.builder() + .jsonProvider(new JacksonJsonNodeJsonProvider(mapper)) + .mappingProvider(new JacksonMappingProvider(mapper)) + .build(); // eventTemplateParser + @JsonInclude(JsonInclude.Include.NON_NULL) public JsonNode eventTemplateParser(String jsonData , String eventName){ JsonNode updatedJson = null; - JsonFactory factory = new JsonFactory(); - ObjectMapper mapper = new ObjectMapper(factory); - mapper.setSerializationInclusion(JsonInclude.Include.NON_ABSENT); - mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + JsonNode rootNode = null; try { String eventTemplate = accessFileInSemanticJar(EVENT_TEMPLATE_PATH + eventName.toLowerCase() + ".json");