From 966abf9459861a0f91925860cbaf82e128d6c5db Mon Sep 17 00:00:00 2001 From: Baule A <65255151+baulea@users.noreply.github.com> Date: Sat, 23 Mar 2024 19:43:15 +0100 Subject: [PATCH] introduce JsonPathJacksonProvider --- core/pom.xml | 4 -- .../di/provider/JsonPathJacksonProvider.java | 37 +++++++++++++ .../array/ArrayIsEmptyAsserterImpl.java | 18 +++---- .../array/ArraySizeAsserterImpl.java | 26 ++++----- .../ZeroCodeAssertionsProcessorImpl.java | 3 +- .../engine/sorter/ZeroCodeSorterImpl.java | 54 ++++++++----------- .../validators/ZeroCodeValidatorImpl.java | 22 ++++++-- .../kafka/helper/KafkaProducerHelper.java | 41 +++++++------- .../converter/MimeTypeConverterTest.java | 19 ++++--- .../ZeroCodeAssertionsProcessorImplTest.java | 31 ++++++----- .../engine/sorter/ZeroCodeSorterImplTest.java | 9 ++-- .../validators/ZeroCodeValidatorImplTest.java | 12 +++-- pom.xml | 5 -- 13 files changed, 160 insertions(+), 121 deletions(-) create mode 100644 core/src/main/java/org/jsmart/zerocode/core/di/provider/JsonPathJacksonProvider.java diff --git a/core/pom.xml b/core/pom.xml index f27010150..6debd337a 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -110,10 +110,6 @@ com.jayway.jsonpath json-path - - net.minidev - json-smart - com.google.classpath-explorer diff --git a/core/src/main/java/org/jsmart/zerocode/core/di/provider/JsonPathJacksonProvider.java b/core/src/main/java/org/jsmart/zerocode/core/di/provider/JsonPathJacksonProvider.java new file mode 100644 index 000000000..867571a63 --- /dev/null +++ b/core/src/main/java/org/jsmart/zerocode/core/di/provider/JsonPathJacksonProvider.java @@ -0,0 +1,37 @@ +package org.jsmart.zerocode.core.di.provider; + +import com.jayway.jsonpath.Configuration; +import com.jayway.jsonpath.Option; +import com.jayway.jsonpath.spi.json.JacksonJsonProvider; +import com.jayway.jsonpath.spi.json.JsonProvider; +import com.jayway.jsonpath.spi.mapper.JacksonMappingProvider; +import com.jayway.jsonpath.spi.mapper.MappingProvider; +import jakarta.inject.Provider; +import java.util.EnumSet; +import java.util.Set; + +public class JsonPathJacksonProvider implements Provider { + @Override + public Configuration.Defaults get() { + return new Configuration.Defaults() { + + private final JsonProvider jsonProvider = new JacksonJsonProvider(); + private final MappingProvider mappingProvider = new JacksonMappingProvider(); + + @Override + public JsonProvider jsonProvider() { + return jsonProvider; + } + + @Override + public MappingProvider mappingProvider() { + return mappingProvider; + } + + @Override + public Set - - net.minidev - json-smart - ${json-smart.version} - com.google.classpath-explorer