aboutsummaryrefslogtreecommitdiffstats
path: root/so-etsi-sol003-adapter-lcm
diff options
context:
space:
mode:
authorMukeshKumar <mukeshsharma@est.tech>2021-08-06 01:00:46 +0100
committerMukesh <mukeshsharma@est.tech>2021-08-06 17:19:37 +0100
commit06b09776f5390fd763a39c9ab1f005e46fc00104 (patch)
tree626e4d818218bca2c53a3b7cb7c0e41c2ac4fed8 /so-etsi-sol003-adapter-lcm
parent89792d8a23d8c83d3097becf6459d4b905305b5b (diff)
Fixing vulnerabilities1.9.0
Issue-ID: SO-3726 Signed-off-by: Mukesh <mukeshsharma@est.tech> Change-Id: Ie23b56383c776033d0577fbdafcb4e8746272a1f
Diffstat (limited to 'so-etsi-sol003-adapter-lcm')
-rw-r--r--so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-api/pom.xml80
-rw-r--r--so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-ext-clients/pom.xml73
-rw-r--r--so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-service/pom.xml10
-rw-r--r--so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-service/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmServiceProviderConfiguration.java14
-rw-r--r--so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-service/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/EtsiSol003AdapterControllerTest.java33
5 files changed, 49 insertions, 161 deletions
diff --git a/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-api/pom.xml b/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-api/pom.xml
index 1ea2077..61c60fd 100644
--- a/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-api/pom.xml
+++ b/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-api/pom.xml
@@ -23,18 +23,20 @@
<configuration>
<inputSpec>${basedir}/src/main/resources/etsisol003adapter.yaml</inputSpec>
<language>java</language>
- <library>retrofit2</library>
<output>${project.build.directory}/generated-sources/etsisol003adapter</output>
<apiPackage>org.onap.so.adapters.etsisol003adapter.lcm.v1.api</apiPackage>
<modelPackage>org.onap.so.adapters.etsisol003adapter.lcm.v1.model</modelPackage>
<generateApiTests>false</generateApiTests>
<generateModelTests>false</generateModelTests>
+ <generateApis>false</generateApis>
+ <generateSupportingFiles>false</generateSupportingFiles>
<configOptions>
<jackson>true</jackson>
<sourceFolder>src/gen/java/main</sourceFolder>
<withXml>true</withXml>
<useRxJava2>true</useRxJava2>
<serializableModel>true</serializableModel>
+ <dateLibrary>java8</dateLibrary>
</configOptions>
</configuration>
</execution>
@@ -48,17 +50,19 @@
${basedir}/src/main/resources/SOL003-VNFLifecycleManagementNotification-API.json
</inputSpec>
<language>java</language>
- <library>okhttp-gson</library>
<output>${project.build.directory}/generated-sources/sol003-vnf-lcn</output>
<apiPackage>org.onap.so.adapters.etsisol003adapter.lcm.lcn.api</apiPackage>
<modelPackage>org.onap.so.adapters.etsisol003adapter.lcm.lcn.model</modelPackage>
<generateApiTests>false</generateApiTests>
<generateModelTests>false</generateModelTests>
+ <generateApis>false</generateApis>
+ <generateSupportingFiles>false</generateSupportingFiles>
<configOptions>
<sourceFolder>src/gen/java/main</sourceFolder>
<withXml>true</withXml>
<useRxJava2>true</useRxJava2>
<serializableModel>true</serializableModel>
+ <dateLibrary>java8</dateLibrary>
</configOptions>
</configuration>
</execution>
@@ -71,12 +75,13 @@
<inputSpec>${basedir}/src/main/resources/SOL003-VNFLifecycleOperationGranting-API.json
</inputSpec>
<language>java</language>
- <library>okhttp-gson</library>
<output>${project.build.directory}/generated-sources/sol003-vnf-grant</output>
<apiPackage>org.onap.so.adapters.etsisol003adapter.lcm.grant.api</apiPackage>
<modelPackage>org.onap.so.adapters.etsisol003adapter.lcm.grant.model</modelPackage>
<generateApiTests>false</generateApiTests>
<generateModelTests>false</generateModelTests>
+ <generateApis>false</generateApis>
+ <generateSupportingFiles>false</generateSupportingFiles>
<configOptions>
<generateSupportingFiles>false</generateSupportingFiles>
<sourceFolder>src/gen/java/main</sourceFolder>
@@ -153,79 +158,10 @@
<version>${swagger-core-version}</version>
</dependency>
<dependency>
- <groupId>com.squareup.retrofit2</groupId>
- <artifactId>converter-gson</artifactId>
- <version>${retrofit-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.retrofit2</groupId>
- <artifactId>retrofit</artifactId>
- <version>${retrofit-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.retrofit2</groupId>
- <artifactId>converter-scalars</artifactId>
- <version>${retrofit-version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.oltu.oauth2</groupId>
- <artifactId>org.apache.oltu.oauth2.client</artifactId>
- <version>${oltu-version}</version>
- </dependency>
- <dependency>
- <groupId>io.gsonfire</groupId>
- <artifactId>gson-fire</artifactId>
- <version>${gson-fire-version}</version>
- </dependency>
- <dependency>
- <groupId>org.threeten</groupId>
- <artifactId>threetenbp</artifactId>
- <version>${threetenbp-version}</version>
- </dependency>
- <dependency>
- <groupId>io.reactivex.rxjava2</groupId>
- <artifactId>rxjava</artifactId>
- </dependency>
- <dependency>
- <groupId>com.squareup.retrofit2</groupId>
- <artifactId>adapter-rxjava2</artifactId>
- <version>${retrofit-version}</version>
- </dependency>
- <dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
- <groupId>com.squareup.okio</groupId>
- <artifactId>okio</artifactId>
- <version>${okio-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.okhttp3</groupId>
- <artifactId>okhttp</artifactId>
- <version>${okhttp3-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.okhttp3</groupId>
- <artifactId>logging-interceptor</artifactId>
- <version>${okhttp3-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.okhttp</groupId>
- <artifactId>logging-interceptor</artifactId>
- <version>${okhttp-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.okhttp</groupId>
- <artifactId>okhttp</artifactId>
- <version>${okhttp-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.okhttp</groupId>
- <artifactId>logging-interceptor</artifactId>
- <version>${okhttp-version}</version>
- </dependency>
- <dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
diff --git a/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-ext-clients/pom.xml b/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-ext-clients/pom.xml
index dbce7b8..8d9f222 100644
--- a/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-ext-clients/pom.xml
+++ b/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-ext-clients/pom.xml
@@ -24,18 +24,20 @@
<configuration>
<inputSpec>${basedir}/src/main/resources/SOL003-VNFLifecycleManagement-API.json</inputSpec>
<language>java</language>
- <library>okhttp-gson</library>
<output>${project.build.directory}/generated-sources/sol003-vnf-lcm</output>
<apiPackage>org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.api</apiPackage>
<modelPackage>org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model</modelPackage>
<generateApiTests>false</generateApiTests>
<generateModelTests>false</generateModelTests>
+ <generateApis>false</generateApis>
+ <generateSupportingFiles>false</generateSupportingFiles>
<configOptions>
<jackson>true</jackson>
<sourceFolder>src/gen/java/main</sourceFolder>
<withXml>true</withXml>
<useRxJava2>true</useRxJava2>
<serializableModel>true</serializableModel>
+ <dateLibrary>java8</dateLibrary>
</configOptions>
</configuration>
</execution>
@@ -98,79 +100,10 @@
<version>${swagger-core-version}</version>
</dependency>
<dependency>
- <groupId>com.squareup.retrofit2</groupId>
- <artifactId>converter-gson</artifactId>
- <version>${retrofit-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.retrofit2</groupId>
- <artifactId>retrofit</artifactId>
- <version>${retrofit-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.retrofit2</groupId>
- <artifactId>converter-scalars</artifactId>
- <version>${retrofit-version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.oltu.oauth2</groupId>
- <artifactId>org.apache.oltu.oauth2.client</artifactId>
- <version>${oltu-version}</version>
- </dependency>
- <dependency>
- <groupId>io.gsonfire</groupId>
- <artifactId>gson-fire</artifactId>
- <version>${gson-fire-version}</version>
- </dependency>
- <dependency>
- <groupId>org.threeten</groupId>
- <artifactId>threetenbp</artifactId>
- <version>${threetenbp-version}</version>
- </dependency>
- <dependency>
- <groupId>io.reactivex.rxjava2</groupId>
- <artifactId>rxjava</artifactId>
- </dependency>
- <dependency>
- <groupId>com.squareup.retrofit2</groupId>
- <artifactId>adapter-rxjava2</artifactId>
- <version>${retrofit-version}</version>
- </dependency>
- <dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
- <groupId>com.squareup.okio</groupId>
- <artifactId>okio</artifactId>
- <version>${okio-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.okhttp3</groupId>
- <artifactId>okhttp</artifactId>
- <version>${okhttp3-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.okhttp3</groupId>
- <artifactId>logging-interceptor</artifactId>
- <version>${okhttp3-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.okhttp</groupId>
- <artifactId>logging-interceptor</artifactId>
- <version>${okhttp-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.okhttp</groupId>
- <artifactId>okhttp</artifactId>
- <version>${okhttp-version}</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.okhttp</groupId>
- <artifactId>logging-interceptor</artifactId>
- <version>${okhttp-version}</version>
- </dependency>
- <dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
diff --git a/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-service/pom.xml b/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-service/pom.xml
index d400ac5..ccf0b40 100644
--- a/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-service/pom.xml
+++ b/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-service/pom.xml
@@ -63,6 +63,16 @@
<groupId>org.onap.so</groupId>
<artifactId>common</artifactId>
<version>${so-core-version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-catalina</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.onap.so</groupId>
diff --git a/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-service/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmServiceProviderConfiguration.java b/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-service/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmServiceProviderConfiguration.java
index 1ed3ec9..026ce03 100644
--- a/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-service/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmServiceProviderConfiguration.java
+++ b/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-service/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmServiceProviderConfiguration.java
@@ -27,6 +27,7 @@ import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
+import java.time.format.DateTimeFormatter;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
@@ -38,8 +39,9 @@ import org.apache.http.impl.client.HttpClients;
import org.apache.http.ssl.SSLContextBuilder;
import org.onap.aai.domain.yang.EsrSystemInfo;
import org.onap.aai.domain.yang.EsrVnfm;
+import org.onap.so.adapters.etsi.sol003.adapter.common.GsonProvider;
import org.onap.so.adapters.etsi.sol003.adapter.common.configuration.AbstractServiceProviderConfiguration;
-import org.onap.so.adapters.etsisol003adapter.lcm.v1.JSON;
+import org.onap.so.adapters.etsi.sol003.adapter.common.utils.LocalDateTimeTypeAdapter;
import org.onap.so.configuration.rest.BasicHttpHeadersProvider;
import org.onap.so.rest.service.HttpRestServiceProvider;
import org.onap.so.rest.service.HttpRestServiceProviderImpl;
@@ -86,6 +88,12 @@ public class VnfmServiceProviderConfiguration extends AbstractServiceProviderCon
@Autowired
private RestTemplate defaultRestTemplate;
+ @Autowired
+ private GsonProvider gsonProvider;
+
+ private final LocalDateTimeTypeAdapter localDateTimeTypeAdapter = new LocalDateTimeTypeAdapter(DateTimeFormatter.ISO_LOCAL_DATE);
+
+
public HttpRestServiceProvider getHttpRestServiceProvider(final EsrVnfm vnfm) {
if (!mapOfVnfmIdToHttpRestServiceProvider.containsKey(vnfm.getVnfmId())) {
mapOfVnfmIdToHttpRestServiceProvider.put(vnfm.getVnfmId(), createHttpRestServiceProvider(vnfm));
@@ -154,7 +162,7 @@ public class VnfmServiceProviderConfiguration extends AbstractServiceProviderCon
@Override
protected Gson getGson() {
- return new JSON().getGson();
+ return gsonProvider.getGson(localDateTimeTypeAdapter);
}
-}
+} \ No newline at end of file
diff --git a/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-service/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/EtsiSol003AdapterControllerTest.java b/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-service/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/EtsiSol003AdapterControllerTest.java
index 5bc4daa..1352e37 100644
--- a/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-service/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/EtsiSol003AdapterControllerTest.java
+++ b/so-etsi-sol003-adapter-lcm/so-etsi-sol003-adapter-lcm-service/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/EtsiSol003AdapterControllerTest.java
@@ -27,13 +27,15 @@ import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.verify;
-import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.VnfmRestTemplateConfiguration;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.content;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
import static org.springframework.test.web.client.response.MockRestResponseCreators.withBadRequest;
import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus;
import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess;
import java.net.URI;
+import java.time.LocalDateTime;
+import java.time.OffsetDateTime;
+import java.time.ZoneOffset;
import java.util.Optional;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
@@ -55,6 +57,7 @@ import org.onap.aaiclient.client.aai.AAIResourcesClient;
import org.onap.aaiclient.client.aai.AAIVersion;
import org.onap.aaiclient.client.aai.entities.uri.AAIBaseResourceUri;
import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri;
+import org.onap.so.adapters.etsi.sol003.adapter.common.GsonProvider;
import org.onap.so.adapters.etsisol003adapter.lcm.extclients.EtsiPackageProvider;
import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.VnfmRestTemplateConfiguration;
import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200;
@@ -63,7 +66,6 @@ import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineRe
import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum;
import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201Links;
import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201LinksSelf;
-import org.onap.so.adapters.etsisol003adapter.lcm.lcn.JSON;
import org.onap.so.adapters.etsisol003adapter.lcm.rest.exceptions.VnfmNotFoundException;
import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.CreateVnfRequest;
import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.CreateVnfResponse;
@@ -87,15 +89,12 @@ import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.client.MockRestServiceServer;
import org.springframework.web.client.RestTemplate;
-import org.threeten.bp.LocalDateTime;
-import org.threeten.bp.OffsetDateTime;
-import org.threeten.bp.ZoneOffset;
-import com.google.gson.Gson;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = TestApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT)
@ActiveProfiles("test")
public class EtsiSol003AdapterControllerTest {
+
private static final OffsetDateTime JAN_1_2019_12_00 =
OffsetDateTime.of(LocalDateTime.of(2019, 1, 1, 12, 0), ZoneOffset.UTC);
@@ -120,7 +119,9 @@ public class EtsiSol003AdapterControllerTest {
@Autowired
EtsiSol003AdapterController controller;
- Gson gson = new JSON().getGson();
+
+ @Autowired
+ GsonProvider gsonProvider;
@Before
public void setUp() throws Exception {
@@ -142,11 +143,11 @@ public class EtsiSol003AdapterControllerTest {
final InlineResponse201 createResponse = createCreateResponse();
mockRestServer.expect(requestTo("http://vnfm2:8080/vnf_instances"))
- .andRespond(withSuccess(gson.toJson(createResponse), MediaType.APPLICATION_JSON));
+ .andRespond(withSuccess(gsonProvider.getGson().toJson(createResponse), MediaType.APPLICATION_JSON));
mockRestServer.expect(requestTo("http://vnfm2:8080/subscriptions"))
.andExpect(content().json(expectedsubscriptionRequest))
- .andRespond(withSuccess(gson.toJson(subscriptionResponse), MediaType.APPLICATION_JSON));
+ .andRespond(withSuccess(gsonProvider.getGson().toJson(subscriptionResponse), MediaType.APPLICATION_JSON));
mockRestServer.expect(requestTo("http://vnfm2:8080/vnf_instances/vnfId/instantiate"))
.andRespond(withStatus(HttpStatus.ACCEPTED).contentType(MediaType.APPLICATION_JSON)
@@ -156,13 +157,13 @@ public class EtsiSol003AdapterControllerTest {
org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationEnum.INSTANTIATE,
org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationStateEnum.PROCESSING);
mockRestServer.expect(requestTo("http://vnfm2:8080/vnf_lcm_op_occs/123456"))
- .andRespond(withSuccess(gson.toJson(firstOperationQueryResponse), MediaType.APPLICATION_JSON));
+ .andRespond(withSuccess(gsonProvider.getGson().toJson(firstOperationQueryResponse), MediaType.APPLICATION_JSON));
final InlineResponse200 secondOperationQueryReponse = createOperationQueryResponse(
org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationEnum.INSTANTIATE,
org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationStateEnum.COMPLETED);
mockRestServer.expect(requestTo("http://vnfm2:8080/vnf_lcm_op_occs/123456"))
- .andRespond(withSuccess(gson.toJson(secondOperationQueryReponse), MediaType.APPLICATION_JSON));
+ .andRespond(withSuccess(gsonProvider.getGson().toJson(secondOperationQueryReponse), MediaType.APPLICATION_JSON));
// Invoke the create request
@@ -217,7 +218,7 @@ public class EtsiSol003AdapterControllerTest {
final InlineResponse201 reponse = new InlineResponse201();
mockRestServer.expect(requestTo(new URI("http://vnfm:8080/vnfs/myTestVnfIdOnVnfm")))
- .andRespond(withSuccess(gson.toJson(reponse), MediaType.APPLICATION_JSON));
+ .andRespond(withSuccess(gsonProvider.getGson().toJson(reponse), MediaType.APPLICATION_JSON));
controller.vnfCreate("myTestVnfId", createVnfRequest, "asadas", "so", "1213");
}
@@ -245,7 +246,7 @@ public class EtsiSol003AdapterControllerTest {
final InlineResponse201 createResponse = createCreateResponse();
mockRestServer.expect(requestTo("http://vnfm2:8080/vnf_instances"))
- .andRespond(withSuccess(gson.toJson(createResponse), MediaType.APPLICATION_JSON));
+ .andRespond(withSuccess(gsonProvider.getGson().toJson(createResponse), MediaType.APPLICATION_JSON));
mockRestServer.expect(requestTo("http://vnfm2:8080/subscriptions")).andRespond(withBadRequest());
@@ -293,13 +294,13 @@ public class EtsiSol003AdapterControllerTest {
org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationEnum.TERMINATE,
org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationStateEnum.PROCESSING);
mockRestServer.expect(requestTo("http://vnfm1:8080/vnf_lcm_op_occs/1234567"))
- .andRespond(withSuccess(gson.toJson(firstOperationQueryResponse), MediaType.APPLICATION_JSON));
+ .andRespond(withSuccess(gsonProvider.getGson().toJson(firstOperationQueryResponse), MediaType.APPLICATION_JSON));
final InlineResponse200 secondOperationQueryReponse = createOperationQueryResponse(
org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationEnum.TERMINATE,
org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationStateEnum.COMPLETED);
mockRestServer.expect(requestTo("http://vnfm1:8080/vnf_lcm_op_occs/1234567"))
- .andRespond(withSuccess(gson.toJson(secondOperationQueryReponse), MediaType.APPLICATION_JSON));
+ .andRespond(withSuccess(gsonProvider.getGson().toJson(secondOperationQueryReponse), MediaType.APPLICATION_JSON));
final RequestEntity<Void> request = RequestEntity
.delete(new URI("http://localhost:" + port + "/so/vnfm-adapter/v1/vnfs/myTestVnfId"))
@@ -340,7 +341,7 @@ public class EtsiSol003AdapterControllerTest {
final InlineResponse201 reponse = new InlineResponse201();
reponse.setInstantiationState(InstantiationStateEnum.NOT_INSTANTIATED);
mockRestServer.expect(requestTo(new URI("http://vnfm:8080/vnfs/myTestVnfIdOnVnfm")))
- .andRespond(withSuccess(gson.toJson(reponse), MediaType.APPLICATION_JSON));
+ .andRespond(withSuccess(gsonProvider.getGson().toJson(reponse), MediaType.APPLICATION_JSON));
mockRestServer.expect(requestTo("http://vnfm:8080/vnfs/myTestVnfIdOnVnfm"))
.andRespond(withStatus(HttpStatus.NO_CONTENT).contentType(MediaType.APPLICATION_JSON));