From 7ce0109856e0cb817de7ea508458b7b8d357ab06 Mon Sep 17 00:00:00 2001 From: Kengo Seki Date: Fri, 28 Aug 2026 21:20:46 +0900 Subject: [PATCH] Update esmf-sdk version to 2.16.0 --- pom.xml | 2 +- src/test/java/com/example/EsmfSdkTest.java | 39 ++++++++++------------ 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index bc0320a..b63fbde 100644 --- a/pom.xml +++ b/pom.xml @@ -17,7 +17,7 @@ ${project.basedir}/src-gen - 2.14.2 + 2.16.0 3.1.1 2.21.0 diff --git a/src/test/java/com/example/EsmfSdkTest.java b/src/test/java/com/example/EsmfSdkTest.java index 77d6bd0..4650af4 100644 --- a/src/test/java/com/example/EsmfSdkTest.java +++ b/src/test/java/com/example/EsmfSdkTest.java @@ -26,17 +26,16 @@ import org.eclipse.esmf.staticmetamodel.constraint.StaticConstraintProperty; import org.eclipse.esmf.staticmetamodel.propertychain.PropertyChain; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import io.catenax.part_as_planned.MetaPartAsPlanned; import io.catenax.part_as_planned.MetaPartTypeInformationEntity; import io.catenax.part_as_planned.PartAsPlanned; import io.catenax.part_as_planned.PartTypeInformationEntity; import org.junit.jupiter.api.Test; +import tools.jackson.core.StreamReadFeature; +import tools.jackson.databind.ObjectMapper; +import tools.jackson.databind.SerializationFeature; +import tools.jackson.databind.cfg.DateTimeFeature; +import tools.jackson.databind.json.JsonMapper; public class EsmfSdkTest { /** @@ -129,13 +128,12 @@ void generateSampleJsonAndParseJson() throws IOException { System.out.println(); // Create Jackson object mapper - final ObjectMapper mapper = new ObjectMapper(); - mapper.registerModule( new JavaTimeModule() ); - mapper.registerModule( new Jdk8Module() ); - mapper.registerModule( new AspectModelJacksonModule() ); - mapper.configure( JsonParser.Feature.INCLUDE_SOURCE_IN_LOCATION, true ); - mapper.configure( SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false ); - mapper.configure( SerializationFeature.FAIL_ON_EMPTY_BEANS, false ); + final ObjectMapper mapper = JsonMapper.builder() + .addModule( new AspectModelJacksonModule() ) + .enable( StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION ) + .disable( DateTimeFeature.WRITE_DATES_AS_TIMESTAMPS ) + .disable( SerializationFeature.FAIL_ON_EMPTY_BEANS ) + .build(); assertThatCode( () -> { // Parse JSON. We now have a type-safe representation of Aspect data. @@ -207,7 +205,7 @@ void useStaticMetaClass() { * piece of data. */ @Test - void deserializeAndUseData() throws JsonProcessingException { + void deserializeAndUseData() throws IOException { final String data = """ { "partTypeInformation" : { @@ -225,13 +223,12 @@ void deserializeAndUseData() throws JsonProcessingException { } """; - final ObjectMapper mapper = new ObjectMapper(); - mapper.registerModule( new JavaTimeModule() ); - mapper.registerModule( new Jdk8Module() ); - mapper.registerModule( new AspectModelJacksonModule() ); - mapper.configure( JsonParser.Feature.INCLUDE_SOURCE_IN_LOCATION, true ); - mapper.configure( SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false ); - mapper.configure( SerializationFeature.FAIL_ON_EMPTY_BEANS, false ); + final ObjectMapper mapper = JsonMapper.builder() + .addModule( new AspectModelJacksonModule() ) + .enable( StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION ) + .disable( DateTimeFeature.WRITE_DATES_AS_TIMESTAMPS ) + .disable( SerializationFeature.FAIL_ON_EMPTY_BEANS ) + .build(); // Parse the data into the type safe representation final PartAsPlanned partAsPlanned = mapper.readValue( data, PartAsPlanned.class );