From 5133d030cc914a1953151b2e009076d0d043ff6e Mon Sep 17 00:00:00 2001 From: MichaelMorris Date: Thu, 30 May 2019 12:01:17 +0000 Subject: Get operation state from VNFM failing Issue-ID: SO-1943 Change-Id: I8d0fd3e9cd4aea26e94a18a6e610abd34f2e5fe9 Signed-off-by: MichaelMorris --- .../extclients/vnfm/VnfmServiceProviderConfiguration.java | 9 ++++++--- .../so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java index 164f12ea29..2aee1c06e3 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java +++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java @@ -20,6 +20,10 @@ package org.onap.so.adapters.vnfmadapter.extclients.vnfm; +import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE; +import com.google.gson.Gson; +import java.util.Iterator; +import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.JSON; import org.onap.so.configuration.rest.BasicHttpHeadersProvider; import org.onap.so.configuration.rest.HttpHeadersProvider; import org.onap.so.rest.service.HttpRestServiceProvider; @@ -32,8 +36,6 @@ import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.GsonHttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.web.client.RestTemplate; -import java.util.Iterator; -import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE; /** * Configures the HttpRestServiceProvider for REST call to a VNFM. @@ -60,7 +62,8 @@ public class VnfmServiceProviderConfiguration { iterator.remove(); } } - restTemplate.getMessageConverters().add(new GsonHttpMessageConverter()); + final Gson gson = new JSON().getGson(); + restTemplate.getMessageConverters().add(new GsonHttpMessageConverter(gson)); } } diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java index 73a49e9c40..b48de30f88 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java +++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java @@ -52,6 +52,7 @@ import org.onap.aai.domain.yang.RelationshipData; import org.onap.aai.domain.yang.RelationshipList; import org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication; import org.onap.so.adapters.vnfmadapter.extclients.SdcPackageProvider; +import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.JSON; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse2001; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201; @@ -115,7 +116,7 @@ public class VnfmAdapterControllerTest { @Autowired VnfmAdapterController controller; - Gson gson = new Gson(); + Gson gson = new JSON().getGson(); @Before public void setUp() throws Exception { -- cgit 1.2.3-korg