From d0b46ad269c870c72e228a9617615b0a828a940c Mon Sep 17 00:00:00 2001 From: "Benjamin, Max" Date: Wed, 18 Mar 2020 13:05:11 -0400 Subject: Correct object provider for jersey Initial setup of aai test for unknown property error updated mapper provider in AAI Client added back support for cxf clients updated aai-schema version to a release version formatted file that was missed moved provider register calls together Issue-ID: SO-2750 Signed-off-by: Benjamin, Max (mb388a) Change-Id: I0bf694f39bbab9bcbabd85bb30fb9dbf23f00520 --- common/src/main/java/org/onap/so/client/RestClient.java | 3 +-- common/src/main/java/org/onap/so/client/aai/AAIVersion.java | 11 ++++++++++- .../org/onap/so/client/policy/CommonObjectMapperProvider.java | 11 ++++++++++- 3 files changed, 21 insertions(+), 4 deletions(-) (limited to 'common/src/main') diff --git a/common/src/main/java/org/onap/so/client/RestClient.java b/common/src/main/java/org/onap/so/client/RestClient.java index 077ba24c2b..30389de742 100644 --- a/common/src/main/java/org/onap/so/client/RestClient.java +++ b/common/src/main/java/org/onap/so/client/RestClient.java @@ -188,8 +188,7 @@ public abstract class RestClient { client.register(new PayloadLoggingClientFilter(this.getMaxPayloadSize())); } CommonObjectMapperProvider provider = this.getCommonObjectMapperProvider(); - client.register(new JacksonJsonProvider(provider.getMapper())); - + client.register(provider).register(new JacksonJsonProvider(provider.getMapper())); metricLogClientFilter = new SOMetricLogClientFilter(); mdcSetup.setTargetEntity(getTargetEntity()); client.register(metricLogClientFilter); diff --git a/common/src/main/java/org/onap/so/client/aai/AAIVersion.java b/common/src/main/java/org/onap/so/client/aai/AAIVersion.java index 4f06b787f7..42887884db 100644 --- a/common/src/main/java/org/onap/so/client/aai/AAIVersion.java +++ b/common/src/main/java/org/onap/so/client/aai/AAIVersion.java @@ -23,7 +23,16 @@ package org.onap.so.client.aai; import org.onap.so.client.graphinventory.GraphInventoryVersion; public enum AAIVersion implements GraphInventoryVersion { - V13("v13"), V14("v14"), V15("v15"), V16("v16"), V17("v17"), V18("v18"), V19("v19"); + V10("V10"), + V11("V11"), + V12("V12"), + V13("v13"), + V14("v14"), + V15("v15"), + V16("v16"), + V17("v17"), + V18("v18"), + V19("v19"); public static final AAIVersion LATEST = AAIVersion.values()[AAIVersion.values().length - 1]; private final String value; diff --git a/common/src/main/java/org/onap/so/client/policy/CommonObjectMapperProvider.java b/common/src/main/java/org/onap/so/client/policy/CommonObjectMapperProvider.java index c55370f7dc..334e0f7231 100644 --- a/common/src/main/java/org/onap/so/client/policy/CommonObjectMapperProvider.java +++ b/common/src/main/java/org/onap/so/client/policy/CommonObjectMapperProvider.java @@ -20,13 +20,16 @@ package org.onap.so.client.policy; +import javax.ws.rs.ext.ContextResolver; +import javax.ws.rs.ext.Provider; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; -public class CommonObjectMapperProvider { +@Provider +public class CommonObjectMapperProvider implements ContextResolver { protected ObjectMapper mapper; @@ -43,4 +46,10 @@ public class CommonObjectMapperProvider { public ObjectMapper getMapper() { return mapper; } + + @Override + public ObjectMapper getContext(Class type) { + + return mapper; + } } -- cgit 1.2.3-korg