Rename other Retrofit clients 76/140376/1
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Tue, 4 Mar 2025 14:25:10 +0000 (15:25 +0100)
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Tue, 4 Mar 2025 14:25:10 +0000 (15:25 +0100)
- complete the renaming from Retrofit service to client

Issue-ID: USECASEUI-882
Change-Id: I20a961059b143311f9d8fd14565178eac9b6806a
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
30 files changed:
server/src/main/java/org/onap/usecaseui/server/config/SDCClientConfig.java
server/src/main/java/org/onap/usecaseui/server/config/SOClientConfig.java
server/src/main/java/org/onap/usecaseui/server/service/csmf/impl/SlicingServiceImpl.java
server/src/main/java/org/onap/usecaseui/server/service/intent/IntentSoClient.java [moved from server/src/main/java/org/onap/usecaseui/server/service/intent/IntentSoService.java with 97% similarity]
server/src/main/java/org/onap/usecaseui/server/service/intent/impl/IntentInstanceServiceImpl.java
server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/sdc/SDCCatalogClient.java [moved from server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/sdc/SDCCatalogService.java with 87% similarity]
server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/so/SOClient.java [moved from server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/so/SOService.java with 98% similarity]
server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcClient.java [moved from server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java with 88% similarity]
server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java
server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceLcmService.java
server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceTemplateService.java
server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImpl.java
server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMgtServiceImpl.java
server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMonitorServiceImpl.java
server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/TaskMgtServiceImpl.java
server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/kpi/KpiSliceClient.java [moved from server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/kpi/KpiSliceService.java with 97% similarity]
server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/SOSliceClient.java [moved from server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/so/SOSliceService.java with 98% similarity]
server/src/test/java/org/onap/usecaseui/server/service/csmf/impl/SlicingServiceImplIntegrationTest.java
server/src/test/java/org/onap/usecaseui/server/service/csmf/impl/SlicingServiceImplTest.java
server/src/test/java/org/onap/usecaseui/server/service/intent/impl/IntentInstanceServiceImplTest.java
server/src/test/java/org/onap/usecaseui/server/service/intent/impl/IntentInstanceServiceIntegrationTest.java
server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionServiceTest.java
server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceLcmServiceTest.java
server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceTemplateServiceIntegrationTest.java
server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceTemplateServiceTest.java
server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImplTest.java
server/src/test/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMgtServiceConvertTest.java
server/src/test/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMgtServiceImplTest.java
server/src/test/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMonitorServiceImplTest.java
server/src/test/java/org/onap/usecaseui/server/service/nsmf/impl/TaskMgtServiceImplTest.java

index 6682363..4efad68 100644 (file)
@@ -18,8 +18,8 @@ package org.onap.usecaseui.server.config;
 
 import java.io.IOException;
 
-import org.onap.usecaseui.server.service.lcm.domain.sdc.SDCCatalogService;
-import org.onap.usecaseui.server.service.lcm.domain.vfc.VfcService;
+import org.onap.usecaseui.server.service.lcm.domain.sdc.SDCCatalogClient;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.VfcClient;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.http.HttpHeaders;
@@ -62,12 +62,12 @@ public class SDCClientConfig {
     }
 
     @Bean
-    SDCCatalogService sdcCatalogService() {
-        return retrofit().create(SDCCatalogService.class);
+    SDCCatalogClient sdcCatalogClient() {
+        return retrofit().create(SDCCatalogClient.class);
     }
 
     @Bean
-    VfcService vfcService() {
-        return retrofit().create(VfcService.class);
+    VfcClient vfcClient() {
+        return retrofit().create(VfcClient.class);
     }
 }
index 62a7e24..9f752b5 100644 (file)
@@ -18,10 +18,10 @@ package org.onap.usecaseui.server.config;
 
 import java.io.IOException;
 
-import org.onap.usecaseui.server.service.intent.IntentSoService;
-import org.onap.usecaseui.server.service.lcm.domain.so.SOService;
-import org.onap.usecaseui.server.service.slicingdomain.kpi.KpiSliceService;
-import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceService;
+import org.onap.usecaseui.server.service.intent.IntentSoClient;
+import org.onap.usecaseui.server.service.lcm.domain.so.SOClient;
+import org.onap.usecaseui.server.service.slicingdomain.kpi.KpiSliceClient;
+import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceClient;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -69,23 +69,23 @@ public class SOClientConfig {
     }
 
     @Bean
-    SOService soService() {
-        return retrofit().create(SOService.class);
+    SOClient soClient() {
+        return retrofit().create(SOClient.class);
     }
 
     @Bean
-    SOSliceService soSliceService() {
-        return retrofit().create(SOSliceService.class);
+    SOSliceClient soSliceClient() {
+        return retrofit().create(SOSliceClient.class);
     }
 
     @Bean
-    IntentSoService intentSoService() {
-        return retrofit().create(IntentSoService.class);
+    IntentSoClient intentSoClient() {
+        return retrofit().create(IntentSoClient.class);
     }
 
     @Bean
     // not at all clear whether this service should interface with SO
-    KpiSliceService kpiSliceService() {
-        return retrofit().create(KpiSliceService.class);
+    KpiSliceClient kpiSliceClient() {
+        return retrofit().create(KpiSliceClient.class);
     }
 }
index 5f2e62c..86c07f1 100644 (file)
@@ -56,7 +56,7 @@ import org.onap.usecaseui.server.service.csmf.config.SlicingProperties;
 import org.onap.usecaseui.server.service.lcm.ServiceLcmService;
 import org.onap.usecaseui.server.service.slicingdomain.aai.AAISliceClient;
 import org.onap.usecaseui.server.service.slicingdomain.aai.bean.AAIServiceInstance;
-import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceService;
+import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceClient;
 import org.onap.usecaseui.server.service.slicingdomain.so.bean.SOOperation;
 import org.onap.usecaseui.server.util.nsmf.NsmfCommonUtil;
 import org.springframework.stereotype.Service;
@@ -70,7 +70,7 @@ public class SlicingServiceImpl implements SlicingService {
     private static final Gson gson = new Gson();
     private final ServiceLcmService serviceLcmService;
     private final AAISliceClient aaiSliceClient;
-    private final SOSliceService soSliceService;
+    private final SOSliceClient soSliceClient;
     private final SlicingProperties slicingProperties;
 
     @Override
@@ -92,7 +92,7 @@ public class SlicingServiceImpl implements SlicingService {
             String jsonstr = gson.toJson(creationRequest);
             log.info("createSlicingService:creationRequest request is:{}", jsonstr);
             RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonstr.toString());
-            Response<CreateResponse> updateResponse = soSliceService
+            Response<CreateResponse> updateResponse = soSliceClient
                 .submitOrders(requestBody).execute();
 
             if (updateResponse.isSuccessful()) {
@@ -289,7 +289,7 @@ public class SlicingServiceImpl implements SlicingService {
             String operationId = serviceInstanceOperations.getOperationId();
             Response<SOOperation> response = null;
             try {
-                response = this.soSliceService.queryOperationProgress(businessId, operationId)
+                response = this.soSliceClient.queryOperationProgress(businessId, operationId)
                     .execute();
                 if (response.isSuccessful()) {
                     SOOperation soOperation = response.body();
@@ -25,7 +25,7 @@ import retrofit2.http.HTTP;
 import retrofit2.http.POST;
 import retrofit2.http.Path;
 
-public interface IntentSoService {
+public interface IntentSoClient {
 
     @POST("/so/infra/serviceIntent/v1/create")
     Call<JSONObject> createIntentInstance(@Body RequestBody body);
index f8fc724..c9ffa6d 100644 (file)
@@ -38,7 +38,7 @@ import org.onap.usecaseui.server.constant.IntentConstant;
 import org.onap.usecaseui.server.service.csmf.SlicingService;
 import org.onap.usecaseui.server.service.intent.IntentAaiClient;
 import org.onap.usecaseui.server.service.intent.IntentInstanceService;
-import org.onap.usecaseui.server.service.intent.IntentSoService;
+import org.onap.usecaseui.server.service.intent.IntentSoClient;
 import org.onap.usecaseui.server.service.intent.config.IntentProperties;
 import org.onap.usecaseui.server.service.nsmf.ResourceMgtService;
 import org.onap.usecaseui.server.util.ExportUtil;
@@ -68,15 +68,15 @@ public class IntentInstanceServiceImpl implements IntentInstanceService {
 
     private final SlicingService slicingService;
     private final IntentAaiClient intentAaiClient;
-    private final IntentSoService intentSoService;
+    private final IntentSoClient intentSoClient;
     private final SessionFactory sessionFactory;
     private final ResourceMgtService resourceMgtService;
     private final IntentProperties intentProperties;
 
-    public IntentInstanceServiceImpl(SlicingService slicingService, IntentAaiClient intentAaiClient, IntentSoService intentSoService, SessionFactory sessionFactory, ResourceMgtService resourceMgtService, IntentProperties intentProperties) {
+    public IntentInstanceServiceImpl(SlicingService slicingService, IntentAaiClient intentAaiClient, IntentSoClient intentSoClient, SessionFactory sessionFactory, ResourceMgtService resourceMgtService, IntentProperties intentProperties) {
         this.slicingService = slicingService;
         this.intentAaiClient = intentAaiClient;
-        this.intentSoService = intentSoService;
+        this.intentSoClient = intentSoClient;
         this.sessionFactory = sessionFactory;
         this.resourceMgtService = resourceMgtService;
         this.intentProperties = defaultPropertiesFromFile(intentProperties);
@@ -241,7 +241,7 @@ public class IntentInstanceServiceImpl implements IntentInstanceService {
         params.put("additionalProperties",additionalProperties);
 
         okhttp3.RequestBody requestBody = okhttp3.RequestBody.create(okhttp3.MediaType.parse("application/json"), JSON.toJSONString(params));
-        Response<JSONObject> response = intentSoService.createIntentInstance(requestBody).execute();
+        Response<JSONObject> response = intentSoClient.createIntentInstance(requestBody).execute();
         if (response.isSuccessful()) {
             return response.body().getString("jobId");
         }
@@ -315,7 +315,7 @@ public class IntentInstanceServiceImpl implements IntentInstanceService {
     }
 
     private int getProgressByJobId(CCVPNInstance instance) throws IOException {
-        Response<JSONObject> response = intentSoService.queryOperationProgress(instance.getResourceInstanceId(), instance.getJobId()).execute();
+        Response<JSONObject> response = intentSoClient.queryOperationProgress(instance.getResourceInstanceId(), instance.getJobId()).execute();
         logger.debug(response.toString());
         if (response.isSuccessful()) {
             if (response.body().containsKey("operation")) {
@@ -495,7 +495,7 @@ public class IntentInstanceServiceImpl implements IntentInstanceService {
         additionalProperties.put("enableSdnc", "true");
         params.put("additionalProperties", additionalProperties);
         okhttp3.RequestBody requestBody = okhttp3.RequestBody.create(okhttp3.MediaType.parse("application/json"), JSON.toJSONString(params));
-        intentSoService.deleteIntentInstance(requestBody).execute();
+        intentSoClient.deleteIntentInstance(requestBody).execute();
     }
     private String deleteInstance(CCVPNInstance instance) {
         Transaction tx = null;
@@ -23,17 +23,17 @@ import retrofit2.http.*;
 
 import java.util.List;
 
-public interface SDCCatalogService {
+public interface SDCCatalogClient {
 
-    @GET("/api/sdc/v1/catalog/services")
+    @GET("v1/catalog/services")
     Call<List<SDCServiceTemplate>> listServices(@Query("category")String category, @Query("distributionStatus") String distributionStatus);
 
-    @GET("/api/sdc/v1/catalog/services/{uuid}/metadata")
+    @GET("v1/catalog/services/{uuid}/metadata")
     Call<SDCServiceTemplate> getService(@Path("uuid") String uuid);
 
     @GET
     Call<ResponseBody> downloadCsar(@Url String fileUrl);
 
-    @GET("/api/sdc/v1/catalog/resources")
+    @GET("v1/catalog/resources")
     Call<List<Vnf>> listResources(@Query("resourceType") String resourceType);
 }
@@ -25,7 +25,7 @@ import org.onap.usecaseui.server.service.lcm.domain.so.bean.ServiceOperation;
 import retrofit2.Call;
 import retrofit2.http.*;
 
-public interface SOService {
+public interface SOClient {
 
     @POST("/api/so-serviceInstances/v3")
     Call<ServiceOperation> instantiateService(@Body RequestBody body);
@@ -26,113 +26,113 @@ import okhttp3.ResponseBody;
 import retrofit2.Call;
 import retrofit2.http.*;
 
-public interface VfcService {
+public interface VfcClient {
 
-    @POST("/api/catalog/v1/nspackages")
+    @POST("catalog/v1/nspackages")
     Call<DistributionResult> distributeNsPackage(@Body Csar csar);
 
-    @POST("/api/catalog/v1/vnfpackages")
+    @POST("catalog/v1/vnfpackages")
     Call<Job> distributeVnfPackage(@Body Csar csar);
 
-    @GET("/api/catalog/v1/jobs/{jobId}")
+    @GET("catalog/v1/jobs/{jobId}")
     Call<JobStatus> getJobStatus(@Path("jobId") String jobId, @Query("responseId") String responseId);
-    
+
     @GET("/api/nslcm/v1/jobs/{jobId}")
     Call<JobStatus> getNsLcmJobStatus(@Path("jobId") String jobId, @Query("responseId") String responseId);
 
-    @DELETE("/api/catalog/v1/nspackages/{csarId}")
+    @DELETE("catalog/v1/nspackages/{csarId}")
     Call<DistributionResult> deleteNsPackage(@Path("csarId") String csarId);
 
-    @DELETE("/api/catalog/v1/vnfpackages/{csarId}")
+    @DELETE("catalog/v1/vnfpackages/{csarId}")
     Call<Job> deleteVnfPackage(@Path("csarId") String csarId);
-    
-    @GET("/api/catalog/v1/nspackages")
+
+    @GET("catalog/v1/nspackages")
     Call<ResponseBody> listNsTemplates();
-    
+
     @POST("/api/parser/v1/parsernsd")
     Call<ResponseBody> fetchNsTemplateData(@Body RequestBody body);
-    
+
     @POST("/api/parser/v1/parser")
     Call<ResponseBody> fetchTemplateInfo(@Body RequestBody body);
-    
+
     @GET("/api/nslcm/v1/ns")
     Call<nsServiceRsp> getNetworkServiceInfo();
-    
+
     @POST("/api/nslcm/v1/ns")
     Call<ResponseBody> createNetworkServiceInstance(@Body RequestBody body);
-    
+
     @POST("/api/nslcm/v1/ns/{ns_instance_id}/instantiate")
     Call<ResponseBody> instantiateNetworkServiceInstance(@Body RequestBody body,@Path("ns_instance_id") String nsInstanceId);
-    
+
     @DELETE("/api/nslcm/v1/ns/{ns_instance_id}")
     Call<ResponseBody> deleteNetworkServiceInstance(@Path("ns_instance_id") String nsInstanceId);
-    
+
     @POST("/api/nslcm/v1/ns/{ns_instance_id}/terminate")
     Call<ResponseBody> terminateNetworkServiceInstance(@Path("ns_instance_id") String nsInstanceId,@Body RequestBody body);
-    
+
     @POST("/api/nslcm/v1/ns/{ns_instance_id}/heal")
     Call<ResponseBody> healNetworkServiceInstance(@Path("ns_instance_id") String nsInstanceId,@Body RequestBody body);
-    
+
     @POST("/api/nslcm/v1/ns/{ns_instance_id}/scale")
     Call<ResponseBody> scaleNetworkServiceInstance(@Path("ns_instance_id") String nsInstanceId,@Body RequestBody body);
-    
+
     @GET("/api/nsd/v1/ns_descriptors")
     Call<ResponseBody> getNetworkServicePackages();
-    
+
     @GET("/api/vnfpkgm/v1/vnf_packages")
     Call<ResponseBody> getVnfPackages();
-    
+
     @GET("/api/nsd/v1/pnf_descriptors")
     Call<ResponseBody> getPnfPackages();
-    
+
     @POST("/api/nsd/v1/ns_descriptors")
     Call<ResponseBody> createNetworkServiceData(@Body RequestBody body);
-    
+
     @POST("/api/vnfpkgm/v1/vnf_packages")
     Call<ResponseBody> createVnfData(@Body RequestBody body);
-    
+
     @POST("/api/nsd/v1/pnf_descriptors")
     Call<ResponseBody> createPnfData(@Body RequestBody body);
-    
+
     @GET("/api/nsd/v1/ns_descriptors/{nsdInfoId}/nsd_content")
     Call<ResponseBody> downLoadNsPackage(@Path("nsdInfoId") String nsdInfoId);
-    
+
     @GET("/api/nsd/v1/ns_descriptors/{nsdInfoId}")
     Call<ResponseBody> getNsdInfo(@Path("nsdInfoId") String nsdInfoId);
-    
+
     @GET("/api/vnfpkgm/v1/vnf_packages/{vnfPkgId}")
     Call<ResponseBody> getVnfInfo(@Path("vnfPkgId") String vnfPkgId);
-    
+
     @GET("/api/nsd/v1/pnf_descriptors/{pnfdInfoId}")
     Call<ResponseBody> getPnfInfo(@Path("pnfdInfoId") String pnfdInfoId);
-    
+
     @GET("/api/nsd/v1/pnf_descriptors/{pnfdInfoId}/pnfd_content")
     Call<ResponseBody> downLoadPnfPackage(@Path("pnfdInfoId") String pnfdInfoId);
-    
+
     @GET("/api/vnfpkgm/v1/vnf_packages/{vnfPkgId}/package_content")
     Call<ResponseBody> downLoadVnfPackage(@Path("vnfPkgId") String vnfPkgId);
-    
+
     @DELETE("/api/nsd/v1/ns_descriptors/{nsdInfoId}")
     Call<ResponseBody> deleteNsdPackage(@Path("nsdInfoId") String nsdInfoId);
-    
+
     @DELETE("/api/vnfpkgm/v1/vnf_packages/{vnfPkgId}")
     Call<ResponseBody> deleteVnfdPackage(@Path("vnfPkgId") String vnfPkgId);
-    
+
     @DELETE("/api/nsd/v1/pnf_descriptors/{pnfdInfoId}")
     Call<ResponseBody> deletePnfdPackage(@Path("pnfdInfoId") String pnfdInfoId);
-    
+
     @GET("/api/nslcm/v1/ns/vnfs/{vnfinstid}")
     Call<ResponseBody> getVnfInfoById(@Path("vnfinstid") String vnfinstid);
 
-    @GET("/api/catalog/v1/service_packages")
+    @GET("catalog/v1/service_packages")
     Call<ResponseBody> servicePackages();
-    
-    @GET("/api/catalog/v1/service_packages/{csarId}")
+
+    @GET("catalog/v1/service_packages/{csarId}")
     Call<ResponseBody> servicePackages(@Path("csarId") String csarId);
-    
-    @POST("/api/catalog/v1/service_packages")
+
+    @POST("catalog/v1/service_packages")
     Call<ResponseBody> servicePackages(@Body RequestBody body);
-    
-    @DELETE("/api/catalog/v1/service_packages/{csarId}")
+
+    @DELETE("catalog/v1/service_packages/{csarId}")
     Call<ResponseBody> deleteServicePackages(@Path("csarId") String csarId);
 }
index 5082442..8d5c94b 100644 (file)
@@ -29,7 +29,6 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
-import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletRequest;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -40,18 +39,15 @@ import org.onap.usecaseui.server.constant.CommonConstant;
 import org.onap.usecaseui.server.service.lcm.PackageDistributionService;
 import org.onap.usecaseui.server.service.lcm.ServiceLcmService;
 import org.onap.usecaseui.server.service.lcm.domain.aai.bean.nsServiceRsp;
-import org.onap.usecaseui.server.service.lcm.domain.sdc.SDCCatalogService;
+import org.onap.usecaseui.server.service.lcm.domain.sdc.SDCCatalogClient;
 import org.onap.usecaseui.server.service.lcm.domain.sdc.bean.SDCServiceTemplate;
 import org.onap.usecaseui.server.service.lcm.domain.sdc.bean.Vnf;
-import org.onap.usecaseui.server.service.lcm.domain.vfc.VfcService;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.VfcClient;
 import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.Csar;
 import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.DistributionResult;
 import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.Job;
 import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.JobStatus;
 import org.onap.usecaseui.server.service.lcm.domain.vfc.exceptions.VfcException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.stereotype.Service;
 
 import com.alibaba.fastjson.JSON;
@@ -66,8 +62,8 @@ import retrofit2.Response;
 @Service("PackageDistributionService")
 public class DefaultPackageDistributionService implements PackageDistributionService {
 
-    private final SDCCatalogService sdcCatalogService;
-    private final VfcService vfcService;
+    private final SDCCatalogClient sdcCatalogClient;
+    private final VfcClient vfcClient;
     private final ServiceLcmService serviceLcmService;
 
     @Override
@@ -80,7 +76,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
     @Override
     public List<Vnf> sdcVfPackageInfo() {
         try {
-            Response<List<Vnf>> response = sdcCatalogService.listResources(RESOURCETYPE_VF).execute();
+            Response<List<Vnf>> response = sdcCatalogClient.listResources(RESOURCETYPE_VF).execute();
             if (response.isSuccessful()) {
                 return response.body();
             } else {
@@ -96,7 +92,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
     @Override
     public List<SDCServiceTemplate> sdcNsPackageInfo() {
         try {
-            Response<List<SDCServiceTemplate>> response = sdcCatalogService.listServices(CATEGORY_NS, DISTRIBUTION_STATUS_DISTRIBUTED).execute();
+            Response<List<SDCServiceTemplate>> response = sdcCatalogClient.listServices(CATEGORY_NS, DISTRIBUTION_STATUS_DISTRIBUTED).execute();
             if (response.isSuccessful()) {
                 return response.body();
             } else {
@@ -112,7 +108,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
     @Override
     public DistributionResult postNsPackage(Csar csar) {
         try {
-            Response<DistributionResult> response = vfcService.distributeNsPackage(csar).execute();
+            Response<DistributionResult> response = vfcClient.distributeNsPackage(csar).execute();
             if (response.isSuccessful()) {
                 return response.body();
             } else {
@@ -127,7 +123,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
     @Override
     public Job postVfPackage(Csar csar) {
         try {
-            Response<Job> response = vfcService.distributeVnfPackage(csar).execute();
+            Response<Job> response = vfcClient.distributeVnfPackage(csar).execute();
             if (response.isSuccessful()) {
                 return response.body();
             } else {
@@ -142,7 +138,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
     @Override
     public JobStatus getJobStatus(String jobId, String responseId) {
         try {
-            Response<JobStatus> response = vfcService.getJobStatus(jobId, responseId).execute();
+            Response<JobStatus> response = vfcClient.getJobStatus(jobId, responseId).execute();
             if (response.isSuccessful()) {
                 return response.body();
             } else {
@@ -156,7 +152,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
 
     @Override
     public JobStatus getNsLcmJobStatus(String serviceInstanceId,String jobId, String responseId,String operationType) {        try {
-        Response<JobStatus> response = vfcService.getNsLcmJobStatus(jobId, responseId).execute();
+        Response<JobStatus> response = vfcClient.getNsLcmJobStatus(jobId, responseId).execute();
         if (response.isSuccessful()) {
             return response.body();
         } else {
@@ -170,7 +166,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
     @Override
     public DistributionResult deleteNsPackage(String csarId) {
         try {
-            Response<DistributionResult> response = vfcService.deleteNsPackage(csarId).execute();
+            Response<DistributionResult> response = vfcClient.deleteNsPackage(csarId).execute();
             if (response.isSuccessful()) {
                 return response.body();
             } else {
@@ -185,7 +181,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
     @Override
     public Job deleteVfPackage(String csarId) {
         try {
-            Response<Job> response = vfcService.deleteVnfPackage(csarId).execute();
+            Response<Job> response = vfcClient.deleteVnfPackage(csarId).execute();
             if (response.isSuccessful()) {
                 return response.body();
             } else {
@@ -202,7 +198,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         String result="";
         try {
             log.info("vfc getVnfPackages is starting!");
-            Response<ResponseBody> response = this.vfcService.getVnfPackages().execute();
+            Response<ResponseBody> response = this.vfcClient.getVnfPackages().execute();
             log.info("vfc getVnfPackages has finished!");
             if (response.isSuccessful()) {
                 result=new String(response.body().bytes());
@@ -223,7 +219,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         String result="";
         try {
             log.info("vfc getNetworkServicePackages is starting!");
-            Response<ResponseBody> response = this.vfcService.getNetworkServicePackages().execute();
+            Response<ResponseBody> response = this.vfcClient.getNetworkServicePackages().execute();
             log.info("vfc getNetworkServicePackages has finished!");
             if (response.isSuccessful()) {
                 result=new String(response.body().bytes());
@@ -245,7 +241,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         String result="";
         try {
             log.info("vfc getPnfPackages is starting!");
-            Response<ResponseBody> response = this.vfcService.getPnfPackages().execute();
+            Response<ResponseBody> response = this.vfcClient.getPnfPackages().execute();
             log.info("vfc getPnfPackages has finished!");
             if (response.isSuccessful()) {
                 result=new String(response.body().bytes());
@@ -267,7 +263,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         String result="";
         try {
             log.info("vfc downLoadNsPackage is starting!");
-            Response<ResponseBody> response = this.vfcService.downLoadNsPackage(nsdInfoId).execute();
+            Response<ResponseBody> response = this.vfcClient.downLoadNsPackage(nsdInfoId).execute();
             log.info("vfc downLoadNsPackage has finished!");
             if (response.isSuccessful()) {
                 result= CommonConstant.CONSTANT_SUCCESS;
@@ -289,7 +285,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         String result="";
         try {
             log.info("vfc downLoadPnfPackage is starting!");
-            Response<ResponseBody> response = this.vfcService.downLoadNsPackage(pnfdInfoId).execute();
+            Response<ResponseBody> response = this.vfcClient.downLoadNsPackage(pnfdInfoId).execute();
             log.info("vfc downLoadPnfPackage has finished!");
             if (response.isSuccessful()) {
                 result= CommonConstant.CONSTANT_SUCCESS;
@@ -311,7 +307,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         String result="";
         try {
             log.info("vfc downLoadVnfPackage is starting!");
-            Response<ResponseBody> response = this.vfcService.downLoadNsPackage(vnfPkgId).execute();
+            Response<ResponseBody> response = this.vfcClient.downLoadNsPackage(vnfPkgId).execute();
             log.info("vfc downLoadVnfPackage has finished!");
             if (response.isSuccessful()) {
                 result= CommonConstant.CONSTANT_SUCCESS;
@@ -333,7 +329,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         String result="";
         try {
             log.info("vfc deleteNsdPackage is starting!");
-            response = this.vfcService.deleteNsdPackage(nsdInfoId).execute();
+            response = this.vfcClient.deleteNsdPackage(nsdInfoId).execute();
             log.info("vfc deleteNsdPackage has finished!");
             if (response.isSuccessful()) {
                 result= CommonConstant.CONSTANT_SUCCESS;
@@ -358,7 +354,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         String result="";
         try {
             log.info("vfc deleteVnfPackage is starting!");
-            response = this.vfcService.deleteVnfdPackage(vnfPkgId).execute();
+            response = this.vfcClient.deleteVnfdPackage(vnfPkgId).execute();
             log.info("vfc deleteVnfPackage has finished!");
             if (response.isSuccessful()) {
                 result= CommonConstant.CONSTANT_SUCCESS;
@@ -383,7 +379,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         String result="";
         try {
             log.info("vfc deletePnfPackage is starting!");
-            response = this.vfcService.deletePnfdPackage(pnfdInfoId).execute();
+            response = this.vfcClient.deletePnfdPackage(pnfdInfoId).execute();
             log.info("vfc deletePnfPackage has finished!");
             if (response.isSuccessful()) {
                 result= CommonConstant.CONSTANT_SUCCESS;
@@ -407,7 +403,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         List<String> result = new ArrayList<>();
         try {
             log.info("vfc getNetworkServiceInfo is starting!");
-            Response<nsServiceRsp> response = this.vfcService.getNetworkServiceInfo().execute();
+            Response<nsServiceRsp> response = this.vfcClient.getNetworkServiceInfo().execute();
             log.info("vfc getNetworkServiceInfo has finished!");
             if (response.isSuccessful()) {
                 List<String> nsServices = response.body().nsServices;
@@ -439,7 +435,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         try {
             log.info("aai createNetworkServiceInstance is starting");
             RequestBody requestBody = extractBody(request);
-            Response<ResponseBody> response = vfcService.createNetworkServiceInstance(requestBody).execute();
+            Response<ResponseBody> response = vfcClient.createNetworkServiceInstance(requestBody).execute();
             log.info("aai createNetworkServiceInstance has finished");
             if (response.isSuccessful()) {
                 result=new String(response.body().bytes());
@@ -460,7 +456,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         String result="";
         try {
             log.info("vfc deleteNetworkServiceInstance is starting!");
-            response = this.vfcService.deleteNetworkServiceInstance(nsInstanceId).execute();
+            response = this.vfcClient.deleteNetworkServiceInstance(nsInstanceId).execute();
             log.info("vfc deleteNetworkServiceInstance has finished!");
             if (response.isSuccessful()) {
                 result= CommonConstant.CONSTANT_SUCCESS;
@@ -485,7 +481,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         try {
             log.info("aai terminateNetworkServiceInstance is starting");
             RequestBody requestBody = extractBody(request);
-            Response<ResponseBody> response = vfcService.terminateNetworkServiceInstance(networkServiceInstanceId,requestBody).execute();
+            Response<ResponseBody> response = vfcClient.terminateNetworkServiceInstance(networkServiceInstanceId,requestBody).execute();
             log.info("aai terminateNetworkServiceInstance has finished");
             if (response.isSuccessful()) {
                 result=new String(response.body().bytes());
@@ -506,7 +502,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         try {
             log.info("aai healNetworkServiceInstance is starting");
             RequestBody requestBody = extractBody(request);
-            Response<ResponseBody> response = vfcService.healNetworkServiceInstance(networkServiceInstanceId,requestBody).execute();
+            Response<ResponseBody> response = vfcClient.healNetworkServiceInstance(networkServiceInstanceId,requestBody).execute();
             log.info("aai healNetworkServiceInstance has finished");
             if (response.isSuccessful()) {
                 result=new String(response.body().bytes());
@@ -527,7 +523,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         try {
             log.info("aai scaleNetworkServiceInstance is starting");
             RequestBody requestBody = extractBody(request);
-            Response<ResponseBody> response = vfcService.scaleNetworkServiceInstance(networkServiceInstanceId,requestBody).execute();
+            Response<ResponseBody> response = vfcClient.scaleNetworkServiceInstance(networkServiceInstanceId,requestBody).execute();
             log.info("aai scaleNetworkServiceInstance has finished");
             if (response.isSuccessful()) {
                 result=new String(response.body().bytes());
@@ -548,7 +544,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         try {
             log.info("aai createNetworkServiceData is starting");
             RequestBody requestBody = extractBody(request);
-            Response<ResponseBody> response = vfcService.createNetworkServiceData(requestBody).execute();
+            Response<ResponseBody> response = vfcClient.createNetworkServiceData(requestBody).execute();
             log.info("aai createNetworkServiceData has finished");
             if (response.isSuccessful()) {
                 result=new String(response.body().bytes());
@@ -569,7 +565,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         try {
             log.info("aai createVnfData is starting");
             RequestBody requestBody = extractBody(request);
-            Response<ResponseBody> response = vfcService.createVnfData(requestBody).execute();
+            Response<ResponseBody> response = vfcClient.createVnfData(requestBody).execute();
             log.info("aai createVnfData has finished");
             if (response.isSuccessful()) {
                 result=new String(response.body().bytes());
@@ -590,7 +586,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         try {
             log.info("aai createPnfData is starting");
             RequestBody requestBody = extractBody(request);
-            Response<ResponseBody> response = vfcService.createPnfData(requestBody).execute();
+            Response<ResponseBody> response = vfcClient.createPnfData(requestBody).execute();
             log.info("aai createPnfData has finished");
             if (response.isSuccessful()) {
                 result=new String(response.body().bytes());
@@ -611,7 +607,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         String result="";
         try {
             log.info("vfc getNsdInfo is starting!");
-            Response<ResponseBody> response = this.vfcService.getNsdInfo(nsdInfoId).execute();
+            Response<ResponseBody> response = this.vfcClient.getNsdInfo(nsdInfoId).execute();
             log.info("vfc getNsdInfo has finished!");
             if (response.isSuccessful()) {
                 result= CommonConstant.CONSTANT_SUCCESS;
@@ -633,7 +629,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         String result="";
         try {
             log.info("vfc getVnfInfo is starting!");
-            Response<ResponseBody> response = this.vfcService.getVnfInfo(vnfPkgId).execute();
+            Response<ResponseBody> response = this.vfcClient.getVnfInfo(vnfPkgId).execute();
             log.info("vfc getVnfInfo has finished!");
             if (response.isSuccessful()) {
                 result= CommonConstant.CONSTANT_SUCCESS;
@@ -655,7 +651,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         String result="";
         try {
             log.info("vfc getPnfInfo is starting!");
-            Response<ResponseBody> response = this.vfcService.getPnfInfo(pnfdInfoId).execute();
+            Response<ResponseBody> response = this.vfcClient.getPnfInfo(pnfdInfoId).execute();
             log.info("vfc getPnfInfo has finished!");
             if (response.isSuccessful()) {
                 result= CommonConstant.CONSTANT_SUCCESS;
@@ -677,7 +673,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         String result="";
         try {
             log.info("vfc listNsTemplates is starting!");
-            Response<ResponseBody> response = this.vfcService.listNsTemplates().execute();
+            Response<ResponseBody> response = this.vfcClient.listNsTemplates().execute();
             log.info("vfc listNsTemplates has finished!");
             if (response.isSuccessful()) {
                 result=new String(response.body().bytes());
@@ -699,7 +695,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         try {
             log.info("aai fetchNsTemplateData is starting");
             RequestBody requestBody = extractBody(request);
-            Response<ResponseBody> response = vfcService.fetchNsTemplateData(requestBody).execute();
+            Response<ResponseBody> response = vfcClient.fetchNsTemplateData(requestBody).execute();
             log.info("aai fetchNsTemplateData has finished");
             if (response.isSuccessful()) {
                 result=new String(response.body().bytes());
@@ -720,12 +716,12 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         try {
             RequestBody requestBody = extractBody(request);
             // search template from vfc catalog
-            Response<ResponseBody> getResponse = this.vfcService.servicePackages(csarId).execute();
+            Response<ResponseBody> getResponse = this.vfcClient.servicePackages(csarId).execute();
 
             if (getResponse.isSuccessful()) {
                 // call vfc template parser
                 log.info("calling ccvpn template file parser is starting");
-                Response<ResponseBody> response = vfcService.fetchTemplateInfo(requestBody).execute();
+                Response<ResponseBody> response = vfcClient.fetchTemplateInfo(requestBody).execute();
                 log.info("calling ccvpn template file parser has finished");
                 if (response.isSuccessful()) {
                     result.put("status", CommonConstant.CONSTANT_SUCCESS);
@@ -737,11 +733,11 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
                }
             } else {
                 // distribute template files to vfc catalog
-                Response<ResponseBody> postResponse = this.vfcService.servicePackages(requestBody).execute();
+                Response<ResponseBody> postResponse = this.vfcClient.servicePackages(requestBody).execute();
                 if (postResponse.isSuccessful()) {
                     // call vfc template parser
                     log.info("calling ccvpn template file parser is starting");
-                    Response<ResponseBody> response = vfcService.fetchTemplateInfo(requestBody).execute();
+                    Response<ResponseBody> response = vfcClient.fetchTemplateInfo(requestBody).execute();
                     log.info("calling ccvpn template file parser has finished");
                     if (response.isSuccessful()) {
                         result.put("status", CommonConstant.CONSTANT_SUCCESS);
@@ -770,7 +766,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         try {
             log.info("aai instantiateNetworkServiceInstance is starting");
             RequestBody requestBody = extractBody(request);
-            Response<ResponseBody> response = vfcService.instantiateNetworkServiceInstance(requestBody,serviceInstanceId).execute();
+            Response<ResponseBody> response = vfcClient.instantiateNetworkServiceInstance(requestBody,serviceInstanceId).execute();
             log.info("aai instantiateNetworkServiceInstance has finished");
             if (response.isSuccessful()) {
                 result=new String(response.body().bytes());
@@ -791,7 +787,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
         String result="";
         try {
             log.info("vfc getVnfInfoById is starting!");
-            Response<ResponseBody> response = this.vfcService.getVnfInfoById(vnfinstid).execute();
+            Response<ResponseBody> response = this.vfcClient.getVnfInfoById(vnfinstid).execute();
             log.info("vfc getVnfInfoById has finished!");
             if (response.isSuccessful()) {
                 result=new String(response.body().bytes());
index ad49bca..00e0dcd 100644 (file)
@@ -35,7 +35,7 @@ import org.hibernate.SessionFactory;
 import org.onap.usecaseui.server.bean.ServiceBean;
 import org.onap.usecaseui.server.bean.ServiceInstanceOperations;
 import org.onap.usecaseui.server.service.lcm.ServiceLcmService;
-import org.onap.usecaseui.server.service.lcm.domain.so.SOService;
+import org.onap.usecaseui.server.service.lcm.domain.so.SOClient;
 import org.onap.usecaseui.server.service.lcm.domain.so.bean.DeleteOperationRsp;
 import org.onap.usecaseui.server.service.lcm.domain.so.bean.OperationProgressInformation;
 import org.onap.usecaseui.server.service.lcm.domain.so.bean.SaveOrUpdateOperationRsp;
@@ -54,7 +54,7 @@ import retrofit2.Response;
 public class DefaultServiceLcmService implements ServiceLcmService {
 
     private final EntityManagerFactory entityManagerFactory;
-    private final SOService soService;
+    private final SOClient soClient;
 
     public Session getSession() {
         return entityManagerFactory.unwrap(SessionFactory.class).getCurrentSession();}
@@ -64,7 +64,7 @@ public class DefaultServiceLcmService implements ServiceLcmService {
         try {
             log.info("so instantiate is starting");
             RequestBody requestBody = extractBody(request);
-            Response<ServiceOperation> response = soService.instantiateService(requestBody).execute();
+            Response<ServiceOperation> response = soClient.instantiateService(requestBody).execute();
             log.info("so instantiate has finished");
             if (response.isSuccessful()) {
                 return response.body();
@@ -82,7 +82,7 @@ public class DefaultServiceLcmService implements ServiceLcmService {
     public OperationProgressInformation queryOperationProgress(String serviceId, String operationId) {
         try {
             Response<OperationProgressInformation> response =
-                    soService.queryOperationProgress(serviceId, operationId).execute();
+                    soClient.queryOperationProgress(serviceId, operationId).execute();
             if (response.isSuccessful()) {
                 return response.body();
             } else {
@@ -100,7 +100,7 @@ public class DefaultServiceLcmService implements ServiceLcmService {
         try {
             log.info("so terminate is starting");
             RequestBody requestBody = extractBody(request);
-            Response<DeleteOperationRsp> response = soService.terminateService(serviceId, requestBody).execute();
+            Response<DeleteOperationRsp> response = soClient.terminateService(serviceId, requestBody).execute();
             log.info("so terminate has finished");
             if (response.isSuccessful()) {
                 return response.body();
@@ -119,7 +119,7 @@ public class DefaultServiceLcmService implements ServiceLcmService {
         try {
             log.info("so scale is finished");
             RequestBody requestBody = extractBody(request);
-            Response<SaveOrUpdateOperationRsp> response = soService.scaleService(serviceId, requestBody).execute();
+            Response<SaveOrUpdateOperationRsp> response = soClient.scaleService(serviceId, requestBody).execute();
             log.info("so scale has finished");
             if (response.isSuccessful()) {
                 log.info("scaleService response content is :" + response.body().toString());
@@ -139,7 +139,7 @@ public class DefaultServiceLcmService implements ServiceLcmService {
         try {
             log.info("so update is starting");
             RequestBody requestBody = extractBody(request);
-            Response<SaveOrUpdateOperationRsp> response = soService.updateService(serviceId, requestBody).execute();
+            Response<SaveOrUpdateOperationRsp> response = soClient.updateService(serviceId, requestBody).execute();
             log.info("so update has finished");
             if (response.isSuccessful()) {
                 return response.body();
index 4dc4856..ce906db 100644 (file)
@@ -30,7 +30,7 @@ import org.onap.usecaseui.server.service.lcm.domain.aai.bean.SDNCControllerRsp;
 import org.onap.usecaseui.server.service.lcm.domain.aai.bean.VimInfo;
 import org.onap.usecaseui.server.service.lcm.domain.aai.bean.VimInfoRsp;
 import org.onap.usecaseui.server.service.lcm.domain.aai.exceptions.AAIException;
-import org.onap.usecaseui.server.service.lcm.domain.sdc.SDCCatalogService;
+import org.onap.usecaseui.server.service.lcm.domain.sdc.SDCCatalogClient;
 import org.onap.usecaseui.server.service.lcm.domain.sdc.bean.SDCServiceTemplate;
 import org.onap.usecaseui.server.service.lcm.domain.sdc.exceptions.SDCCatalogException;
 import org.onap.usecaseui.server.util.RestfulServices;
@@ -55,7 +55,7 @@ import static org.onap.usecaseui.server.service.lcm.domain.sdc.consts.SDCConsts.
 @Service("ServiceTemplateService")
 public class DefaultServiceTemplateService implements ServiceTemplateService {
 
-    private final SDCCatalogService sdcCatalog;
+    private final SDCCatalogClient sdcCatalog;
     private final AAIClient aaiClient;
 
     @Override
index 27204b3..646e01e 100644 (file)
@@ -29,7 +29,7 @@ import org.onap.usecaseui.server.service.lcm.domain.aai.AAIClient;
 import org.onap.usecaseui.server.service.lcm.domain.aai.bean.Relationship;
 import org.onap.usecaseui.server.service.lcm.domain.so.bean.DeleteOperationRsp;
 import org.onap.usecaseui.server.service.lcm.domain.so.bean.ServiceOperation;
-import org.onap.usecaseui.server.service.lcm.domain.so.SOService;
+import org.onap.usecaseui.server.service.lcm.domain.so.SOClient;
 import org.onap.usecaseui.server.service.lcm.domain.so.bean.Operation;
 import org.onap.usecaseui.server.service.lcm.domain.so.exceptions.SOException;
 import org.onap.usecaseui.server.bean.lcm.sotne2eservice.*;
@@ -60,7 +60,7 @@ public class SotnServiceTemplateServiceImpl implements SotnServiceTemplateServic
 
     private static final Logger logger = LoggerFactory.getLogger(SotnServiceTemplateServiceImpl.class);
 
-    private SOService soService;
+    private SOClient soClient;
     private AAIClient aaiClient;
 
     private Map<String, Model> readConfigToMap(ModelConfig modelConfig) {
@@ -133,7 +133,7 @@ public class SotnServiceTemplateServiceImpl implements SotnServiceTemplateServic
         Operation result = new Operation();
         try {
               logger.info("SO instantiate SOTN service is starting");
-            Response<ServiceOperation> sotnserviceresponse = soService.instantiateSOTNService(requestBody).execute();
+            Response<ServiceOperation> sotnserviceresponse = soClient.instantiateSOTNService(requestBody).execute();
               logger.info("SO instantiate SOTN service has finished");
             if (sotnserviceresponse.isSuccessful()) {
                 logger.info("SO instantiate SOTN service is successful");
@@ -525,7 +525,7 @@ public class SotnServiceTemplateServiceImpl implements SotnServiceTemplateServic
             try {
                 logger.info("so begin terminate site service " + siteserviceId);
                 RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), requestStr);
-                Response<DeleteOperationRsp> response = soService.terminateService(siteserviceId, requestBody).execute();
+                Response<DeleteOperationRsp> response = soClient.terminateService(siteserviceId, requestBody).execute();
                 logger.info("so terminate has finished");
                 if (response.isSuccessful()) {
                     logger.info("so terminated site service " + siteserviceId + "successfully...");
@@ -547,7 +547,7 @@ public class SotnServiceTemplateServiceImpl implements SotnServiceTemplateServic
         try {
             logger.info("so begin terminate Connectivity service " + serviceId);
             RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), requestStr);
-            Response<DeleteOperationRsp> response = soService.terminateService(serviceId, requestBody).execute();
+            Response<DeleteOperationRsp> response = soClient.terminateService(serviceId, requestBody).execute();
             logger.info("so terminate has finished");
             if (response.isSuccessful()) {
                 logger.info("so terminated connectivity service " + serviceId + "successfully...");
index 9f6ebf2..d54c660 100644 (file)
@@ -56,7 +56,7 @@ import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.Relat
 import org.onap.usecaseui.server.bean.nsmf.resource.ConnectionLinkInfo;
 import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.SliceProfileInfo;
 import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.SliceProfileList;
-import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceService;
+import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceClient;
 import org.onap.usecaseui.server.service.slicingdomain.so.bean.ActivateService;
 import org.onap.usecaseui.server.service.slicingdomain.so.bean.SOOperation;
 import org.onap.usecaseui.server.util.DateUtils;
@@ -81,7 +81,7 @@ public class ResourceMgtServiceImpl implements ResourceMgtService {
     private static final Gson gson = new Gson();
 
     private final AAISliceClient aaiSliceClient;
-    private final SOSliceService soSliceService;
+    private final SOSliceClient soSliceClient;
 
     @Resource(name = "ServiceLcmService")
     private ServiceLcmService serviceLcmService;
@@ -166,7 +166,7 @@ public class ResourceMgtServiceImpl implements ResourceMgtService {
             String operationId = serviceInstanceOperations.getOperationId();
             Response<SOOperation> response = null;
             try {
-                response = this.soSliceService.queryOperationProgress(businessId, operationId)
+                response = this.soSliceClient.queryOperationProgress(businessId, operationId)
                     .execute();
                 if (response.isSuccessful()) {
                     SOOperation soOperation = response.body();
@@ -748,7 +748,7 @@ public class ResourceMgtServiceImpl implements ResourceMgtService {
                 NsmfParamConstant.SERVICE_TYPE_5G);
             String jsonstr = JSON.toJSONString(subscriberInfo);
             RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonstr);
-            Response<ActivateService> activeResponse = this.soSliceService.activeService(serviceId, requestBody)
+            Response<ActivateService> activeResponse = this.soSliceClient.activeService(serviceId, requestBody)
                 .execute();
 
             if (activeResponse.isSuccessful()) {
@@ -796,7 +796,7 @@ public class ResourceMgtServiceImpl implements ResourceMgtService {
                 NsmfParamConstant.SERVICE_TYPE_5G);
             String jsonstr = JSON.toJSONString(subscriberInfo);
             RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonstr.toString());
-            Response<ActivateService> activeResponse = this.soSliceService.deactiveService(serviceId, requestBody)
+            Response<ActivateService> activeResponse = this.soSliceClient.deactiveService(serviceId, requestBody)
                 .execute();
 
             if (activeResponse.isSuccessful()) {
@@ -844,7 +844,7 @@ public class ResourceMgtServiceImpl implements ResourceMgtService {
                 NsmfParamConstant.SERVICE_TYPE_5G);
             String jsonstr = JSON.toJSONString(subscriberInfo);
             RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonstr);
-            Response<ActivateService> activeResponse = this.soSliceService.terminateService(serviceId, requestBody)
+            Response<ActivateService> activeResponse = this.soSliceClient.terminateService(serviceId, requestBody)
                 .execute();
 
             if (activeResponse.isSuccessful()) {
@@ -893,7 +893,7 @@ public class ResourceMgtServiceImpl implements ResourceMgtService {
             if (serviceInstanceOperations != null) {
                 String operationId = serviceInstanceOperations.getOperationId();
                 logger.info("queryOperationProgress: operationId is:{}", operationId);
-                Response<SOOperation> response = this.soSliceService.queryOperationProgress(serviceId, operationId)
+                Response<SOOperation> response = this.soSliceClient.queryOperationProgress(serviceId, operationId)
                     .execute();
                 if (response.isSuccessful()) {
                     SOOperation soOperation = response.body();
index acc1585..9038e77 100644 (file)
@@ -45,7 +45,7 @@ import org.onap.usecaseui.server.bean.nsmf.monitor.UsageTrafficList;
 import org.onap.usecaseui.server.constant.nsmf.NsmfCodeConstant;
 import org.onap.usecaseui.server.constant.nsmf.NsmfParamConstant;
 import org.onap.usecaseui.server.service.nsmf.ResourceMonitorService;
-import org.onap.usecaseui.server.service.slicingdomain.kpi.KpiSliceService;
+import org.onap.usecaseui.server.service.slicingdomain.kpi.KpiSliceClient;
 import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.KpiTotalBandwidth;
 import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.KpiTotalTraffic;
 import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.KpiUserNumber;
@@ -64,7 +64,7 @@ public class ResourceMonitorServiceImpl implements ResourceMonitorService {
     private static final Logger logger = LoggerFactory.getLogger(ResourceMonitorServiceImpl.class);
     private static final Gson gson = new Gson();
 
-    private final KpiSliceService kpiSliceService;
+    private final KpiSliceClient kpiSliceClient;
 
     @Autowired
     private ResourceMonitorServiceConvert resourceMonitorServiceConvert;
@@ -102,7 +102,7 @@ public class ResourceMonitorServiceImpl implements ResourceMonitorService {
                     .buildTrafficReqInfo(serviceInfo, newTimestamp);
                 String jsonstr = JSON.toJSONString(trafficReqInfo);
                 RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonstr);
-                Response<KpiTotalTraffic> response = this.kpiSliceService.listTotalTraffic(requestBody).execute();
+                Response<KpiTotalTraffic> response = this.kpiSliceClient.listTotalTraffic(requestBody).execute();
                 if (response.isSuccessful()) {
                     KpiTotalTraffic kpiTotalTraffic = response.body();
                     logger.info("querySlicingUsageTraffic: listTotalTraffic reponse is:{}",
@@ -154,7 +154,7 @@ public class ResourceMonitorServiceImpl implements ResourceMonitorService {
                     .buildSlicingKpiReqInfo(serviceInfo, newTimestamp, kpiHours);
                 String jsonstr = JSON.toJSONString(slicingKpiReqInfo);
                 RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonstr);
-                Response<KpiUserNumber> response = this.kpiSliceService.listUserNumber(requestBody).execute();
+                Response<KpiUserNumber> response = this.kpiSliceClient.listUserNumber(requestBody).execute();
 
                 if (response.isSuccessful()) {
                     KpiUserNumber kpiUserNumber = response.body();
@@ -209,7 +209,7 @@ public class ResourceMonitorServiceImpl implements ResourceMonitorService {
                     .buildSlicingKpiReqInfo(serviceInfo, newTimestamp, kpiHours);
                 String jsonstr = JSON.toJSONString(slicingKpiReqInfo);
                 RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonstr);
-                Response<KpiTotalBandwidth> response = this.kpiSliceService.listTotalBandwidth(requestBody).execute();
+                Response<KpiTotalBandwidth> response = this.kpiSliceClient.listTotalBandwidth(requestBody).execute();
 
                 if (response.isSuccessful()) {
                     KpiTotalBandwidth kpiTotalBandwidth = response.body();
@@ -263,7 +263,7 @@ public class ResourceMonitorServiceImpl implements ResourceMonitorService {
                     .buildSlicingPDUSessionEstSRKpiReqInfo(serviceInfo, queryTimestamp, kpiHours);
                 String jsonstr = JSON.toJSONString(slicingKpiReqInfo);
                 RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonstr);
-                Response<KpiPDUSessionEstSR> response =this.kpiSliceService.listPDUSessionEstSR(requestBody).execute();
+                Response<KpiPDUSessionEstSR> response =this.kpiSliceClient.listPDUSessionEstSR(requestBody).execute();
                 if (response.isSuccessful()) {
                     KpiPDUSessionEstSR kpiPDUSessionEstSR = response.body();
                     logger.info("querySlicingPDUSessionEstSR: listPDUSessionEstSR reponse is:{}",
index 73b376b..f128b7f 100644 (file)
@@ -43,7 +43,7 @@ import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connectionvo.Con
 import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connectionvo.ConnectionVo;
 import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connectionvo.EndPointInfoListVo;
 import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connectionvo.PropertiesVo;
-import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceService;
+import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceClient;
 import org.onap.usecaseui.server.service.slicingdomain.so.bean.SOTask;
 import org.onap.usecaseui.server.service.slicingdomain.so.bean.SOTaskRsp;
 import org.onap.usecaseui.server.util.RestfulServices;
@@ -69,7 +69,7 @@ public class TaskMgtServiceImpl implements TaskMgtService {
 
     private static final Logger logger = LoggerFactory.getLogger(TaskMgtServiceImpl.class);
 
-    private final SOSliceService soSliceService;
+    private final SOSliceClient soSliceClient;
     private final AAISliceClient aaiSliceClient;
 
     @Resource(name = "TaskMgtConvertService")
@@ -86,7 +86,7 @@ public class TaskMgtServiceImpl implements TaskMgtService {
         String resultMsg;
 
         try {
-            Response<JSONArray> response = this.soSliceService.listTask().execute();
+            Response<JSONArray> response = this.soSliceClient.listTask().execute();
             if (response.isSuccessful()) {
                 Gson gson = new Gson();
                 Type type = new TypeToken<List<SOTask>>() {
@@ -127,7 +127,7 @@ public class TaskMgtServiceImpl implements TaskMgtService {
         SOTaskRsp soTaskRsp = new SOTaskRsp();
         String resultMsg;
         try {
-            Response<JSONArray> response = this.soSliceService.listTaskByStage(status).execute();
+            Response<JSONArray> response = this.soSliceClient.listTaskByStage(status).execute();
             if (response.isSuccessful()) {
                 Gson gson = new Gson();
                 Type type = new TypeToken<List<SOTask>>() {
@@ -168,7 +168,7 @@ public class TaskMgtServiceImpl implements TaskMgtService {
 
         try {
             // TODO
-            Response<SOTask> response = this.soSliceService.getTaskById(taskId).execute();
+            Response<SOTask> response = this.soSliceClient.getTaskById(taskId).execute();
             if (response.isSuccessful()) {
                 SOTask soTaskInfo = response.body();
                 Gson gson = new Gson();
@@ -203,7 +203,7 @@ public class TaskMgtServiceImpl implements TaskMgtService {
         ResultHeader resultHeader = new ResultHeader();
         String resultMsg;
         try {
-            Response<SOTask> response = this.soSliceService.getTaskById(slicingTaskAuditInfo.getTaskId()).execute();
+            Response<SOTask> response = this.soSliceClient.getTaskById(slicingTaskAuditInfo.getTaskId()).execute();
             if (response.isSuccessful()) {
                 SOTask soTaskInfo = response.body();
                 Gson gson = new Gson();
@@ -214,11 +214,11 @@ public class TaskMgtServiceImpl implements TaskMgtService {
                 String jsonstr = JSON.toJSONString(soTaskInfo);
                 logger.info("updateTaskAuditInfo: the requestBody body is:{}", jsonstr);
                 RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonstr);
-                Response<ResponseBody> updateResponse = soSliceService
+                Response<ResponseBody> updateResponse = soSliceClient
                     .updateService(slicingTaskAuditInfo.getTaskId(), requestBody).execute();
 
                 if (updateResponse.isSuccessful()) {
-                    Response<ResponseBody> commitResponse = this.soSliceService
+                    Response<ResponseBody> commitResponse = this.soSliceClient
                         .commitTask(slicingTaskAuditInfo.getTaskId()).execute();
                     if (commitResponse.isSuccessful()) {
                         resultMsg = "5G slicing task submit result.";
@@ -266,7 +266,7 @@ public class TaskMgtServiceImpl implements TaskMgtService {
         String resultMsg;
 
         try {
-            Response<SOTask> response = this.soSliceService.getTaskByIdD(taskId).execute();
+            Response<SOTask> response = this.soSliceClient.getTaskByIdD(taskId).execute();
             if (response.isSuccessful()) {
                 Gson gson = new Gson();
                 SOTask soTask = response.body();
@@ -307,7 +307,7 @@ public class TaskMgtServiceImpl implements TaskMgtService {
         String resultMsg;
 
         try {
-            Response<SOTask> response = this.soSliceService.getTaskByIdD(taskId).execute();
+            Response<SOTask> response = this.soSliceClient.getTaskByIdD(taskId).execute();
             if (response.isSuccessful()) {
                 SOTask soTask = response.body();
                 Gson gson = new Gson();
@@ -25,7 +25,7 @@ import retrofit2.Call;
 import retrofit2.http.Body;
 import retrofit2.http.POST;
 
-public interface KpiSliceService {
+public interface KpiSliceClient {
 
     @POST("/api/datalake/v1/exposure/userNumber")
     Call<KpiUserNumber> listUserNumber(@Body RequestBody body);
@@ -33,7 +33,7 @@ import retrofit2.http.PUT;
 import retrofit2.http.Path;
 import retrofit2.http.Query;
 
-public interface SOSliceService {
+public interface SOSliceClient {
 
        @GET("/api/so-serviceInstances/v3/{serviceId}/operations/{operationId}")
        Call<SOOperation> queryOperationProgress(@Path("serviceId") String serviceId,
index fb039d7..4cda6cb 100644 (file)
@@ -48,7 +48,7 @@ import org.onap.usecaseui.server.service.csmf.config.SlicingProperties;
 import org.onap.usecaseui.server.service.lcm.ServiceLcmService;
 import org.onap.usecaseui.server.service.lcm.impl.DefaultServiceLcmService;
 import org.onap.usecaseui.server.service.slicingdomain.aai.AAISliceClient;
-import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceService;
+import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceClient;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -90,7 +90,7 @@ public class SlicingServiceImplIntegrationTest {
 
     @MockBean ServiceLcmService serviceLcmService;
     @Autowired AAISliceClient aaiSliceClient;
-    @Autowired SOSliceService soSliceService;
+    @Autowired SOSliceClient soSliceClient;
     @Autowired SlicingProperties slicingProperties;
 
     SlicingService slicingService;
@@ -112,7 +112,7 @@ public class SlicingServiceImplIntegrationTest {
 
     @BeforeEach
     void setup() {
-      slicingService = new SlicingServiceImpl(serviceLcmService,aaiSliceClient,soSliceService, slicingProperties);
+      slicingService = new SlicingServiceImpl(serviceLcmService,aaiSliceClient,soSliceClient, slicingProperties);
     }
 
     @Test
index 624e11c..b45e2c5 100644 (file)
@@ -48,7 +48,7 @@ import org.onap.usecaseui.server.service.csmf.config.SlicingProperties;
 import org.onap.usecaseui.server.service.lcm.ServiceLcmService;
 import org.onap.usecaseui.server.service.lcm.impl.DefaultServiceLcmService;
 import org.onap.usecaseui.server.service.slicingdomain.aai.AAISliceClient;
-import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceService;
+import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceClient;
 import org.onap.usecaseui.server.service.slicingdomain.so.bean.SOOperation;
 import org.powermock.api.support.membermodification.MemberModifier;
 import retrofit2.Call;
@@ -56,7 +56,7 @@ import retrofit2.Call;
 public class SlicingServiceImplTest {
 
     SlicingServiceImpl slicingService = null;
-    SOSliceService soSliceService;
+    SOSliceClient soSliceClient;
     AAISliceClient aaiSliceClient;
     ServiceLcmService serviceLcmService;
     SlicingProperties slicingProperties;
@@ -64,10 +64,10 @@ public class SlicingServiceImplTest {
     @Before
     public void before() throws Exception {
         aaiSliceClient = mock(AAISliceClient.class);
-        soSliceService = mock(SOSliceService.class);
+        soSliceClient = mock(SOSliceClient.class);
         serviceLcmService = mock(DefaultServiceLcmService.class);
         slicingProperties = mock(SlicingProperties.class);
-        slicingService = new SlicingServiceImpl(serviceLcmService, aaiSliceClient, soSliceService, slicingProperties);
+        slicingService = new SlicingServiceImpl(serviceLcmService, aaiSliceClient, soSliceClient, slicingProperties);
         MemberModifier.field(SlicingServiceImpl.class, "serviceLcmService").set(slicingService , serviceLcmService);
     }
 
@@ -90,7 +90,7 @@ public class SlicingServiceImplTest {
 
         CreateResponse createResponse = new CreateResponse();
         RequestBody requestBody = null;
-        when(soSliceService
+        when(soSliceClient
             .submitOrders(requestBody))
             .thenReturn(successfulCall(createResponse));
         slicingService.createSlicingService(slicingOrder);
@@ -101,7 +101,7 @@ public class SlicingServiceImplTest {
 
         SlicingOrder slicingOrder = new SlicingOrder();
         RequestBody requestBody = null;
-        when(soSliceService
+        when(soSliceClient
             .submitOrders(requestBody))
             .thenReturn(failedCall("so is not exist!"));
         slicingService.createSlicingService(slicingOrder);
@@ -172,7 +172,7 @@ public class SlicingServiceImplTest {
         String businessId = "test123";
         String operationId = "opera123";
         when(serviceLcmService.getServiceInstanceOperationById(businessId)).thenReturn(new ServiceInstanceOperations());
-        when(soSliceService.queryOperationProgress(businessId, operationId))
+        when(soSliceClient.queryOperationProgress(businessId, operationId))
             .thenReturn(successfulCall(soOperation));
         slicingService.addProgressToOrder(orderList);
     }
@@ -195,7 +195,7 @@ public class SlicingServiceImplTest {
 
         String businessId = "test123";
         String operationId = "opera123";
-        when(soSliceService.queryOperationProgress(businessId, operationId))
+        when(soSliceClient.queryOperationProgress(businessId, operationId))
             .thenReturn(failedCall("so is not exist!"));
         slicingService.addProgressToOrder(orderList);
     }
index 57dca9f..aff792e 100644 (file)
@@ -47,7 +47,7 @@ import org.onap.usecaseui.server.bean.nsmf.common.ServiceResult;
 import org.onap.usecaseui.server.constant.IntentConstant;
 import org.onap.usecaseui.server.service.csmf.SlicingService;
 import org.onap.usecaseui.server.service.intent.IntentAaiClient;
-import org.onap.usecaseui.server.service.intent.IntentSoService;
+import org.onap.usecaseui.server.service.intent.IntentSoClient;
 import org.onap.usecaseui.server.service.intent.config.IntentProperties;
 import org.onap.usecaseui.server.service.lcm.domain.so.bean.OperationProgress;
 import org.onap.usecaseui.server.service.lcm.domain.so.bean.OperationProgressInformation;
@@ -80,7 +80,7 @@ public class IntentInstanceServiceImplTest {
     private IntentAaiClient intentAaiClient;
 
     @Mock
-    private IntentSoService intentSoService;
+    private IntentSoClient intentSoClient;
 
     @Mock
     private IntentProperties intentProperties;
@@ -105,7 +105,7 @@ public class IntentInstanceServiceImplTest {
         MemberModifier.field(IntentInstanceServiceImpl.class, "resourceMgtService").set(intentInstanceService , resourceMgtService);
         MemberModifier.field(IntentInstanceServiceImpl.class, "slicingService").set(intentInstanceService , slicingService);
         MemberModifier.field(IntentInstanceServiceImpl.class, "intentAaiClient").set(intentInstanceService , intentAaiClient);
-        MemberModifier.field(IntentInstanceServiceImpl.class, "intentSoService").set(intentInstanceService , intentSoService);
+        MemberModifier.field(IntentInstanceServiceImpl.class, "intentSoClient").set(intentInstanceService , intentSoClient);
         when(sessionFactory.openSession()).thenReturn(session);
 
         when(intentProperties.getGlobalCustomerId()).thenReturn("someCustomer");
@@ -165,7 +165,7 @@ public class IntentInstanceServiceImplTest {
         Call mockCall = PowerMockito.mock(Call.class);
         JSONObject body = JSONObject.parseObject("{\"jobId\":\"123\"}");
         Response<JSONObject> response = Response.success(body);
-        Mockito.when(intentSoService.createIntentInstance(any())).thenReturn(mockCall);
+        Mockito.when(intentSoClient.createIntentInstance(any())).thenReturn(mockCall);
         Mockito.when(mockCall.execute()).thenReturn(response);
 
         IntentInstanceServiceImpl spy = PowerMockito.spy(intentInstanceService);
@@ -190,7 +190,7 @@ public class IntentInstanceServiceImplTest {
         Call mockCall = PowerMockito.mock(Call.class);
         JSONObject body = JSONObject.parseObject("{\"jobId\":\"123\"}");
         Response<JSONObject> response = Response.success(body);
-        Mockito.when(intentSoService.createIntentInstance(any())).thenReturn(mockCall);
+        Mockito.when(intentSoClient.createIntentInstance(any())).thenReturn(mockCall);
         Mockito.when(mockCall.execute()).thenReturn(response);
 
         IntentInstanceServiceImpl spy = PowerMockito.spy(intentInstanceService);
@@ -237,7 +237,7 @@ public class IntentInstanceServiceImplTest {
         jsonObject.put("operation", operation);
         Call mockCall = PowerMockito.mock(Call.class);
         Response<JSONObject> response = Response.success(jsonObject);
-        Mockito.when(intentSoService.queryOperationProgress(anyString(),anyString())).thenReturn(mockCall);
+        Mockito.when(intentSoClient.queryOperationProgress(anyString(),anyString())).thenReturn(mockCall);
         Mockito.when(mockCall.execute()).thenReturn(response);
 
         IntentInstanceServiceImpl spy = PowerMockito.spy(intentInstanceService);
@@ -454,7 +454,7 @@ public class IntentInstanceServiceImplTest {
         when(query.uniqueResult()).thenReturn(instance);
 
         Call mockCall = PowerMockito.mock(Call.class);
-        when(intentSoService.deleteIntentInstance(any())).thenReturn(mockCall);
+        when(intentSoClient.deleteIntentInstance(any())).thenReturn(mockCall);
         when(mockCall.execute()).thenReturn(null);
 
         Transaction tx = PowerMockito.mock(Transaction.class);
@@ -481,7 +481,7 @@ public class IntentInstanceServiceImplTest {
         when(query.uniqueResult()).thenReturn(instance);
 
         Call mockCall = PowerMockito.mock(Call.class);
-        when(intentSoService.deleteIntentInstance(any())).thenReturn(mockCall);
+        when(intentSoClient.deleteIntentInstance(any())).thenReturn(mockCall);
         when(mockCall.execute()).thenReturn(null);
 
         Transaction tx = PowerMockito.mock(Transaction.class);
@@ -536,7 +536,7 @@ public class IntentInstanceServiceImplTest {
         Call mockCall = PowerMockito.mock(Call.class);
         JSONObject body = JSONObject.parseObject("{\"jobId\":\"123\"}");
         Response<JSONObject> response = Response.success(body);
-        Mockito.when(intentSoService.createIntentInstance(any())).thenReturn(mockCall);
+        Mockito.when(intentSoClient.createIntentInstance(any())).thenReturn(mockCall);
         Mockito.when(mockCall.execute()).thenReturn(response);
 
         Transaction tx = Mockito.mock(Transaction.class);
index 17e4459..d7b9ac3 100644 (file)
@@ -47,7 +47,7 @@ import org.onap.usecaseui.server.service.csmf.SlicingService;
 import org.onap.usecaseui.server.service.csmf.config.SlicingProperties;
 import org.onap.usecaseui.server.service.csmf.impl.SlicingServiceImpl;
 import org.onap.usecaseui.server.service.intent.IntentAaiClient;
-import org.onap.usecaseui.server.service.intent.IntentSoService;
+import org.onap.usecaseui.server.service.intent.IntentSoClient;
 import org.onap.usecaseui.server.service.intent.config.IntentProperties;
 import org.onap.usecaseui.server.service.lcm.impl.DefaultServiceLcmService;
 import org.onap.usecaseui.server.service.nsmf.impl.ResourceMgtServiceImpl;
@@ -116,7 +116,7 @@ public class IntentInstanceServiceIntegrationTest {
   IntentAaiClient intentAaiClient;
 
   @Autowired
-  IntentSoService intentSoService;
+  IntentSoClient intentSoClient;
 
   @Autowired
   IntentProperties intentProperties;
@@ -130,7 +130,7 @@ public class IntentInstanceServiceIntegrationTest {
     Transaction transaction = mock(Transaction.class);
     when(sessionFactory.openSession()).thenReturn(session);
     when(session.beginTransaction()).thenReturn(transaction);
-    this.intentService = new IntentInstanceServiceImpl(slicingService, intentAaiClient, intentSoService, sessionFactory,
+    this.intentService = new IntentInstanceServiceImpl(slicingService, intentAaiClient, intentSoClient, sessionFactory,
         resourceMgtServiceImpl, intentProperties);
   }
 
index 4701324..5e43688 100644 (file)
@@ -32,10 +32,10 @@ import org.onap.usecaseui.server.service.lcm.domain.aai.AAIClient;
 import org.onap.usecaseui.server.service.lcm.domain.aai.bean.VimInfo;
 import org.onap.usecaseui.server.service.lcm.domain.aai.bean.VimInfoRsp;
 import org.onap.usecaseui.server.service.lcm.domain.aai.bean.nsServiceRsp;
-import org.onap.usecaseui.server.service.lcm.domain.sdc.SDCCatalogService;
+import org.onap.usecaseui.server.service.lcm.domain.sdc.SDCCatalogClient;
 import org.onap.usecaseui.server.service.lcm.domain.sdc.bean.SDCServiceTemplate;
 import org.onap.usecaseui.server.service.lcm.domain.sdc.bean.Vnf;
-import org.onap.usecaseui.server.service.lcm.domain.vfc.VfcService;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.VfcClient;
 import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.Csar;
 import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.DistributionResult;
 import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.Job;
@@ -130,7 +130,7 @@ public class DefaultPackageDistributionServiceTest {
         o.setUuid("2");
         o.setName("vnf");
         List<Vnf> vnf = Collections.singletonList(o);
-        SDCCatalogService sdcService = newSDCService(serviceTemplate, vnf);
+        SDCCatalogClient sdcService = newSDCService(serviceTemplate, vnf);
 
         List<VimInfo> vim = Collections.singletonList(new VimInfo("owner", "regionId"));
         AAIClient aaiClient = newAAIService(vim);
@@ -149,8 +149,8 @@ public class DefaultPackageDistributionServiceTest {
         return aaiClient;
     }
 
-    private SDCCatalogService newSDCService(List<SDCServiceTemplate> serviceTemplate, List<Vnf> vnf) {
-        SDCCatalogService sdcService = mock(SDCCatalogService.class);
+    private SDCCatalogClient newSDCService(List<SDCServiceTemplate> serviceTemplate, List<Vnf> vnf) {
+        SDCCatalogClient sdcService = mock(SDCCatalogClient.class);
 
         Call<List<SDCServiceTemplate>> serviceCall = successfulCall(serviceTemplate);
         when(sdcService.listServices(CATEGORY_NS, DISTRIBUTION_STATUS_DISTRIBUTED)).thenReturn(serviceCall);
@@ -162,7 +162,7 @@ public class DefaultPackageDistributionServiceTest {
 
     @Test
     public void retrievePackageWillThrowExceptionWhenSDCIsNotAvailable() {
-        SDCCatalogService sdcService = mock(SDCCatalogService.class);
+        SDCCatalogClient sdcService = mock(SDCCatalogClient.class);
         Call<List<Vnf>> serviceCall = failedCall("SDC is not available!");
         Call<List<SDCServiceTemplate>> serviceCall1 = failedCall("SDC is not available!");
         when(sdcService.listServices(CATEGORY_NS, DISTRIBUTION_STATUS_DISTRIBUTED)).thenReturn(serviceCall1);
@@ -177,7 +177,7 @@ public class DefaultPackageDistributionServiceTest {
 
     @Test
     public void retrievePackageWillBeEmptyWhenNoNsServiceAndVfInSDC() {
-        SDCCatalogService sdcService = mock(SDCCatalogService.class);
+        SDCCatalogClient sdcService = mock(SDCCatalogClient.class);
         Call<List<SDCServiceTemplate>> serviceCall = emptyBodyCall();
         when(sdcService.listServices(CATEGORY_NS, DISTRIBUTION_STATUS_DISTRIBUTED)).thenReturn(serviceCall);
 
@@ -193,132 +193,132 @@ public class DefaultPackageDistributionServiceTest {
 
     @Test
     public void itCanPostNsPackageToVFC() {
-        VfcService vfcService = mock(VfcService.class);
+        VfcClient vfcClient = mock(VfcClient.class);
         Csar csar = new Csar();
         DistributionResult result = new DistributionResult();
         result.setStatus("status");
         result.setStatusDescription("description");
         result.setErrorCode("errorcode");
-        when(vfcService.distributeNsPackage(csar)).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        when(vfcClient.distributeNsPackage(csar)).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame(result, service.postNsPackage(csar));
     }
 
     @Test(expected = VfcException.class)
     public void postNsPackageWillThrowExceptionWhenVFCIsNotAvailable() {
-        VfcService vfcService = mock(VfcService.class);
+        VfcClient vfcClient = mock(VfcClient.class);
         Csar csar = new Csar();
-        when(vfcService.distributeNsPackage(csar)).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        when(vfcClient.distributeNsPackage(csar)).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.postNsPackage(csar);
     }
 
     @Test(expected = VfcException.class)
     public void postNsPackageWillThrowExceptionWhenVFCResponseError() {
-        VfcService vfcService = mock(VfcService.class);
+        VfcClient vfcClient = mock(VfcClient.class);
         Csar csar = new Csar();
-        when(vfcService.distributeNsPackage(csar)).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        when(vfcClient.distributeNsPackage(csar)).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.postNsPackage(csar);
     }
 
     @Test
     public void itCanPostVnfPackageToVFC() {
-        VfcService vfcService = mock(VfcService.class);
+        VfcClient vfcClient = mock(VfcClient.class);
         Csar csar = new Csar();
         Job job = new Job();
-        when(vfcService.distributeVnfPackage(csar)).thenReturn(successfulCall(job));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        when(vfcClient.distributeVnfPackage(csar)).thenReturn(successfulCall(job));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame(job, service.postVfPackage(csar));
     }
 
     @Test(expected = VfcException.class)
     public void postVnfPackageWillThrowExceptionWhenVFCIsNotAvailable() {
-        VfcService vfcService = mock(VfcService.class);
+        VfcClient vfcClient = mock(VfcClient.class);
         Csar csar = new Csar();
-        when(vfcService.distributeVnfPackage(csar)).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        when(vfcClient.distributeVnfPackage(csar)).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.postVfPackage(csar);
     }
 
     @Test(expected = VfcException.class)
     public void postVnfPackageWillThrowExceptionWhenVFCResponseError() {
-        VfcService vfcService = mock(VfcService.class);
+        VfcClient vfcClient = mock(VfcClient.class);
         Csar csar = new Csar();
-        when(vfcService.distributeVnfPackage(csar)).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        when(vfcClient.distributeVnfPackage(csar)).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.postVfPackage(csar);
     }
 
     @Test
     public void itCanGetJobStatusFromVFC() {
-        VfcService vfcService = mock(VfcService.class);
+        VfcClient vfcClient = mock(VfcClient.class);
         String jobId = "1";
         String responseId = "1";
         JobStatus jobStatus = new JobStatus();
-        when(vfcService.getJobStatus(jobId, responseId)).thenReturn(successfulCall(jobStatus));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        when(vfcClient.getJobStatus(jobId, responseId)).thenReturn(successfulCall(jobStatus));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame(jobStatus, service.getJobStatus(jobId, responseId));
     }
 
     @Test(expected = VfcException.class)
     public void getJobStatusWillThrowExceptionWhenVFCIsNotAvailable() {
-        VfcService vfcService = mock(VfcService.class);
+        VfcClient vfcClient = mock(VfcClient.class);
         String jobId = "1";
         String responseId = "1";
-        when(vfcService.getJobStatus(jobId, responseId)).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        when(vfcClient.getJobStatus(jobId, responseId)).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.getJobStatus(jobId, responseId);
     }
 
     @Test(expected = VfcException.class)
     public void getJobStatusWillThrowExceptionWhenVFCResponseError() {
-        VfcService vfcService = mock(VfcService.class);
+        VfcClient vfcClient = mock(VfcClient.class);
         String jobId = "1";
         String responseId = "1";
-        when(vfcService.getJobStatus(jobId, responseId)).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        when(vfcClient.getJobStatus(jobId, responseId)).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.getJobStatus(jobId, responseId);
     }
 
     @Test
     public void itCanGetNsLcmJobStatusFromVFC() {
-        VfcService vfcService = mock(VfcService.class);
+        VfcClient vfcClient = mock(VfcClient.class);
         String jobId = "1";
         String responseId = "1";
         String serviceId= "1";
         String operationType= "1";
         JobStatus jobStatus = new JobStatus();
-        when(vfcService.getNsLcmJobStatus(jobId, responseId)).thenReturn(successfulCall(jobStatus));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        when(vfcClient.getNsLcmJobStatus(jobId, responseId)).thenReturn(successfulCall(jobStatus));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame(jobStatus, service.getNsLcmJobStatus(serviceId,jobId, responseId,operationType));
     }
 
     @Test(expected = VfcException.class)
     public void getNsLcmJobStatusWillThrowExceptionWhenVFCIsNotAvailable() {
-        VfcService vfcService = mock(VfcService.class);
+        VfcClient vfcClient = mock(VfcClient.class);
         String jobId = "1";
         String responseId = "1";
         String serviceId= "1";
         String operationType= "1";
-        when(vfcService.getNsLcmJobStatus(jobId, responseId)).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        when(vfcClient.getNsLcmJobStatus(jobId, responseId)).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.getNsLcmJobStatus(serviceId,jobId, responseId,operationType);
     }
 
     @Test(expected = VfcException.class)
     public void getNsLcmJobStatusWillThrowExceptionWhenVFCResponseError() {
-        VfcService vfcService = mock(VfcService.class);
+        VfcClient vfcClient = mock(VfcClient.class);
         String jobId = "1";
         String responseId = "1";
         String serviceId= "1";
         String operationType= "1";
-        when(vfcService.getNsLcmJobStatus(jobId, responseId)).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        when(vfcClient.getNsLcmJobStatus(jobId, responseId)).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.getNsLcmJobStatus(serviceId,jobId, responseId,operationType);
     }
 
@@ -326,9 +326,9 @@ public class DefaultPackageDistributionServiceTest {
     public void itCanDeleteNsPackage() {
         String csarId = "1";
         DistributionResult result = new DistributionResult();
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deleteNsPackage(csarId)).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deleteNsPackage(csarId)).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame(result, service.deleteNsPackage(csarId));
     }
@@ -336,27 +336,27 @@ public class DefaultPackageDistributionServiceTest {
     @Test(expected = VfcException.class)
     public void deleteNsPackageWillThrowExceptionWhenVFCIsNotAvailable() {
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deleteNsPackage(csarId)).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deleteNsPackage(csarId)).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.deleteNsPackage(csarId);
     }
 
     @Test(expected = VfcException.class)
     public void deleteNsPackageWillThrowExceptionWhenVFCResponseError() {
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deleteNsPackage(csarId)).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deleteNsPackage(csarId)).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.deleteNsPackage(csarId);
     }
 
     @Test
     public void itCanGetVnfPackages(){
        //ResponseBody result=null;
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getVnfPackages()).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getVnfPackages()).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
        // Assert.assertSame(result, service.getVnfPackages());
         Assert.assertNotNull(service.getVnfPackages());
@@ -365,17 +365,17 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void getVnfPackagesThrowExceptionWhenVFCResponseError(){
 
-       VfcService vfcService = mock(VfcService.class);
-       when(vfcService.getVnfPackages ()).thenReturn(emptyBodyCall());
-       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+       VfcClient vfcClient = mock(VfcClient.class);
+       when(vfcClient.getVnfPackages ()).thenReturn(emptyBodyCall());
+       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
        service.getVnfPackages();
     }
 
     @Test
     public void getVnfPackagesThrowException(){
-       VfcService vfcService = mock(VfcService.class);
-       when(vfcService.getVnfPackages ()).thenReturn(failedCall("VFC is not available!"));
-       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+       VfcClient vfcClient = mock(VfcClient.class);
+       when(vfcClient.getVnfPackages ()).thenReturn(failedCall("VFC is not available!"));
+       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
        service.getVnfPackages();
     }
 
@@ -383,9 +383,9 @@ public class DefaultPackageDistributionServiceTest {
     public void itCanDeleteVFPackage() {
         String csarId = "1";
         Job job = new Job();
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deleteVnfPackage(csarId)).thenReturn(successfulCall(job));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deleteVnfPackage(csarId)).thenReturn(successfulCall(job));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame(job, service.deleteVfPackage(csarId));
     }
@@ -393,50 +393,50 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void deleteVfPackageWillThrowExceptionWhenVFCIsNotAvailable() {
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deleteVnfdPackage(csarId)).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deleteVnfdPackage(csarId)).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         Assert.assertSame("{\"status\":\"FAILED\"}",service.deleteVnfPackage(csarId));
     }
 
     @Test
     public void deleteVnfPackageWillThrowExceptionWhenVFCResponseError() {
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deleteVnfdPackage(csarId)).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deleteVnfdPackage(csarId)).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.deleteVnfPackage(csarId);
     }
 
     @Test
     public void itCanGetNetworkServicePackages() {
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getNetworkServicePackages()).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getNetworkServicePackages()).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         Assert.assertNotNull(service.getNetworkServicePackages());
     }
 
     @Test
     public void getNetworkServicePackagesWillThrowExceptionWhenVFCIsNotAvailable() {
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getNetworkServicePackages()).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getNetworkServicePackages()).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.getNetworkServicePackages();
     }
 
     @Test
     public void getNetworkServicePackagesWillThrowExceptionWhenVFCResponseError() {
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getNetworkServicePackages()).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getNetworkServicePackages()).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.getNetworkServicePackages();
     }
 
     @Test
     public void itCanGetPnfPackages(){
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getPnfPackages()).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getPnfPackages()).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertNotNull(service.getPnfPackages());
     }
@@ -444,17 +444,17 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void getPnfPackagesThrowExceptionWhenVFCResponseError(){
 
-       VfcService vfcService = mock(VfcService.class);
-       when(vfcService.getPnfPackages ()).thenReturn(emptyBodyCall());
-       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+       VfcClient vfcClient = mock(VfcClient.class);
+       when(vfcClient.getPnfPackages ()).thenReturn(emptyBodyCall());
+       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
        service.getPnfPackages();
     }
 
     @Test
     public void getPnfPackagesThrowException(){
-       VfcService vfcService = mock(VfcService.class);
-       when(vfcService.getPnfPackages ()).thenReturn(failedCall("VFC is not available!"));
-       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+       VfcClient vfcClient = mock(VfcClient.class);
+       when(vfcClient.getPnfPackages ()).thenReturn(failedCall("VFC is not available!"));
+       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
        service.getPnfPackages();
     }
 
@@ -462,9 +462,9 @@ public class DefaultPackageDistributionServiceTest {
     public void itDownLoadNsPackage(){
        String nsdInfoId="1";
        ResponseBody successResponse=null;
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.downLoadNsPackage(nsdInfoId)).thenReturn(successfulCall(successResponse));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.downLoadNsPackage(nsdInfoId)).thenReturn(successfulCall(successResponse));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         String result = service.downLoadNsPackage(nsdInfoId);
         assertNotNull(result);
@@ -474,27 +474,27 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void downLoadNsPackagehrowExceptionWhenVFCResponseError(){
        String nsdInfoId="1";
-       VfcService vfcService = mock(VfcService.class);
-       when(vfcService.downLoadNsPackage (nsdInfoId)).thenReturn(emptyBodyCall());
-       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+       VfcClient vfcClient = mock(VfcClient.class);
+       when(vfcClient.downLoadNsPackage (nsdInfoId)).thenReturn(emptyBodyCall());
+       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
        service.downLoadNsPackage(nsdInfoId);
     }
 
     @Test
     public void downLoadNsPackageThrowException(){
        String nsdInfoId="1";
-       VfcService vfcService = mock(VfcService.class);
-       when(vfcService.downLoadNsPackage (nsdInfoId)).thenReturn(failedCall("VFC is not available!"));
-       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+       VfcClient vfcClient = mock(VfcClient.class);
+       when(vfcClient.downLoadNsPackage (nsdInfoId)).thenReturn(failedCall("VFC is not available!"));
+       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
        service.downLoadNsPackage(nsdInfoId);
     }
 
     @Test
     public void itDownLoadPnfPackage(){
        String pnfInfoId="1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.downLoadNsPackage(pnfInfoId)).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.downLoadNsPackage(pnfInfoId)).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame("{\"status\":\"SUCCESS\"}", service.downLoadPnfPackage(pnfInfoId));
     }
@@ -502,27 +502,27 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void downLoadPnfPackagehrowExceptionWhenVFCResponseError(){
        String pnfInfoId="1";
-       VfcService vfcService = mock(VfcService.class);
-       when(vfcService.downLoadNsPackage (pnfInfoId)).thenReturn(emptyBodyCall());
-       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+       VfcClient vfcClient = mock(VfcClient.class);
+       when(vfcClient.downLoadNsPackage (pnfInfoId)).thenReturn(emptyBodyCall());
+       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
        service.downLoadPnfPackage(pnfInfoId);
     }
 
     @Test
     public void downLoadPnfPackageThrowException(){
        String pnfInfoId="1";
-       VfcService vfcService = mock(VfcService.class);
-       when(vfcService.downLoadNsPackage (pnfInfoId)).thenReturn(failedCall("VFC is not available!"));
-       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+       VfcClient vfcClient = mock(VfcClient.class);
+       when(vfcClient.downLoadNsPackage (pnfInfoId)).thenReturn(failedCall("VFC is not available!"));
+       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
        service.downLoadPnfPackage(pnfInfoId);
     }
 
     @Test
     public void itDownLoadVnfPackage(){
        String vnfInfoId="1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.downLoadNsPackage(vnfInfoId)).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.downLoadNsPackage(vnfInfoId)).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame("{\"status\":\"SUCCESS\"}", service.downLoadVnfPackage(vnfInfoId));
     }
@@ -530,18 +530,18 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void downLoadVnfPackagehrowExceptionWhenVFCResponseError(){
        String vnfInfoId="1";
-       VfcService vfcService = mock(VfcService.class);
-        when(vfcService.downLoadNsPackage (vnfInfoId)).thenReturn(failedCall("VFC is not available!"));
-       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+       VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.downLoadNsPackage (vnfInfoId)).thenReturn(failedCall("VFC is not available!"));
+       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
        service.downLoadVnfPackage(vnfInfoId);
     }
 
     @Test
     public void downLoadVnfPackageThrowException(){
        String vnfInfoId="1";
-       VfcService vfcService = mock(VfcService.class);
-       when(vfcService.downLoadNsPackage (vnfInfoId)).thenReturn(failedCall("VFC is not available!"));
-       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+       VfcClient vfcClient = mock(VfcClient.class);
+       when(vfcClient.downLoadNsPackage (vnfInfoId)).thenReturn(failedCall("VFC is not available!"));
+       PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
        service.downLoadVnfPackage(vnfInfoId);
     }
 
@@ -549,9 +549,9 @@ public class DefaultPackageDistributionServiceTest {
     public void itCanDeleteNsdPackage() {
         String csarId = "1";
         ResponseBody result=null;
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deleteNsdPackage(csarId)).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deleteNsdPackage(csarId)).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame("{\"status\":\"SUCCESS\"}", service.deleteNsdPackage(csarId));
     }
@@ -559,27 +559,27 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void deleteNsdPackageWillThrowExceptionWhenVFCIsNotAvailable() {
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deleteNsdPackage(csarId)).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deleteNsdPackage(csarId)).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.deleteNsdPackage(csarId);
     }
 
     @Test
     public void deleteNsdPackageWillThrowExceptionWhenVFCResponseError() {
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deleteNsdPackage(csarId)).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deleteNsdPackage(csarId)).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.deleteNsdPackage(csarId);
     }
 
     @Test
     public void itCanDeleteVnfPackage() {
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deleteVnfdPackage(csarId)).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deleteVnfdPackage(csarId)).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertNotNull(service.deleteVnfPackage(csarId));
     }
@@ -587,18 +587,18 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void deleteVnfPackageWillThrowExceptionWhenVFCIsNotAvailable() {
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deleteVnfdPackage(csarId)).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deleteVnfdPackage(csarId)).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.deleteVnfPackage(csarId);
     }
 
     @Test
     public void deleteVnfNsdPackageWillThrowExceptionWhenVFCResponseError() {
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deleteVnfdPackage(csarId)).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deleteVnfdPackage(csarId)).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.deleteVnfPackage(csarId);
         Assert.assertSame("{\"status\":\"FAILED\"}", service.deleteVnfPackage(csarId));
     }
@@ -608,9 +608,9 @@ public class DefaultPackageDistributionServiceTest {
         String csarId = "1";
         ResponseBody result=null;
         Job job = new Job();
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deletePnfdPackage(csarId)).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deletePnfdPackage(csarId)).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame("{\"status\":\"SUCCESS\"}", service.deletePnfPackage(csarId));
     }
@@ -618,18 +618,18 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void deletePnfPackageWillThrowExceptionWhenVFCIsNotAvailable() {
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deletePnfdPackage(csarId)).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deletePnfdPackage(csarId)).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.deletePnfPackage(csarId);
     }
 
     @Test
     public void deletePnfPackageWillThrowExceptionWhenVFCResponseError() {
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deletePnfdPackage(csarId)).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deletePnfdPackage(csarId)).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.deletePnfPackage(csarId);
     }
 
@@ -638,9 +638,9 @@ public class DefaultPackageDistributionServiceTest {
         String csarId = "1";
         ResponseBody result=null;
         Job job = new Job();
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deleteNetworkServiceInstance(csarId)).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deleteNetworkServiceInstance(csarId)).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame("{\"status\":\"SUCCESS\"}", service.deleteNetworkServiceInstance(csarId));
     }
@@ -648,18 +648,18 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void deleteNetworkServiceInstanceWillThrowExceptionWhenVFCIsNotAvailable() {
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deleteNetworkServiceInstance(csarId)).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deleteNetworkServiceInstance(csarId)).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.deleteNetworkServiceInstance(csarId);
     }
 
     @Test
     public void deleteNetworkServiceInstanceWillThrowExceptionWhenVFCResponseError() {
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.deleteNetworkServiceInstance(csarId)).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.deleteNetworkServiceInstance(csarId)).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.deleteNetworkServiceInstance(csarId);
     }
 
@@ -667,9 +667,9 @@ public class DefaultPackageDistributionServiceTest {
     public void itCanCreateNetworkServiceInstance() throws IOException {
        HttpServletRequest request = mockRequest();
         ResponseBody result=null;
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.createNetworkServiceInstance(Mockito.any())).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.createNetworkServiceInstance(Mockito.any())).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame("{\"status\":\"FAILED\"}", service.createNetworkServiceInstance(request));
     }
@@ -677,18 +677,18 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void createNetworkServiceInstanceWillThrowExceptionWhenVFCIsNotAvailable() throws IOException {
        HttpServletRequest request = mockRequest();
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.createNetworkServiceInstance(Mockito.any())).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.createNetworkServiceInstance(Mockito.any())).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.createNetworkServiceInstance(request);
     }
 
     @Test
     public void createNetworkServiceInstanceWillThrowExceptionWhenVFCResponseError() throws IOException {
        HttpServletRequest request = mockRequest();
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.createNetworkServiceInstance(Mockito.any())).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.createNetworkServiceInstance(Mockito.any())).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.createNetworkServiceInstance(request);
     }
 
@@ -699,27 +699,27 @@ public class DefaultPackageDistributionServiceTest {
         String s = "{\"nsInstanceId\":\"nsInstanceId\"}";
         list.add(s);
         ns.setNsServices(list);
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getNetworkServiceInfo()).thenReturn(successfulCall(ns));
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getNetworkServiceInfo()).thenReturn(successfulCall(ns));
         ServiceLcmService serviceLcmService = mock(ServiceLcmService.class);
-        DefaultPackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, serviceLcmService);
+        DefaultPackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, serviceLcmService);
         when(serviceLcmService.getServiceBeanByServiceInStanceId("nsInstanceId")).thenReturn(new ServiceBean());
         Assert.assertNotNull( service.getNetworkServiceInfo());
     }
 
     @Test
     public void getNetworkServiceInfoWillThrowExceptionWhenVFCIsNotAvailable() throws IOException {
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getNetworkServiceInfo()).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getNetworkServiceInfo()).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.getNetworkServiceInfo();
     }
 
     @Test
     public void getNetworkServiceInfoWillThrowExceptionWhenVFCResponseError() throws IOException {
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getNetworkServiceInfo()).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getNetworkServiceInfo()).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.getNetworkServiceInfo();
     }
 
@@ -730,9 +730,9 @@ public class DefaultPackageDistributionServiceTest {
        HttpServletRequest request = mockRequest();
         String csarId = "1";
         ResponseBody result=null;
-        VfcService vfcService = mock(VfcService.class);
-        //when(vfcService.healNetworkServiceInstance(csarId,anyObject())).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        //when(vfcClient.healNetworkServiceInstance(csarId,anyObject())).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         //Assert.assertSame(result, service.healNetworkServiceInstance(request,csarId));
         service.healNetworkServiceInstance(request,csarId);
@@ -742,9 +742,9 @@ public class DefaultPackageDistributionServiceTest {
     public void healNetworkServiceInstanceWillThrowExceptionWhenVFCIsNotAvailable() throws IOException {
        HttpServletRequest request = mockRequest();
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.healNetworkServiceInstance(eq(csarId),Mockito.any())).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.healNetworkServiceInstance(eq(csarId),Mockito.any())).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.healNetworkServiceInstance(request,csarId);
     }
 
@@ -752,9 +752,9 @@ public class DefaultPackageDistributionServiceTest {
     public void healNetworkServiceInstanceWillThrowExceptionWhenVFCResponseError() throws IOException {
        HttpServletRequest request = mockRequest();
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.healNetworkServiceInstance(eq(csarId),Mockito.any())).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.healNetworkServiceInstance(eq(csarId),Mockito.any())).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.healNetworkServiceInstance(request,csarId);
     }
 
@@ -762,8 +762,8 @@ public class DefaultPackageDistributionServiceTest {
     public void itCanScaleNetworkServiceInstance() throws IOException {
        HttpServletRequest request = mockRequest();
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         String result = service.scaleNetworkServiceInstance(request,csarId);
         assertNotNull(result);
@@ -774,9 +774,9 @@ public class DefaultPackageDistributionServiceTest {
     public void scaleNetworkServiceInstanceWillThrowExceptionWhenVFCIsNotAvailable() throws IOException {
        HttpServletRequest request = mockRequest();
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.scaleNetworkServiceInstance(eq(csarId),Mockito.any())).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.scaleNetworkServiceInstance(eq(csarId),Mockito.any())).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.scaleNetworkServiceInstance(request,csarId);
     }
 
@@ -784,9 +784,9 @@ public class DefaultPackageDistributionServiceTest {
     public void scaleNetworkServiceInstanceWillThrowExceptionWhenVFCResponseError() throws IOException {
        HttpServletRequest request = mockRequest();
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.scaleNetworkServiceInstance(eq(csarId),Mockito.any())).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.scaleNetworkServiceInstance(eq(csarId),Mockito.any())).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.scaleNetworkServiceInstance(request,csarId);
     }
 
@@ -796,9 +796,9 @@ public class DefaultPackageDistributionServiceTest {
        HttpServletRequest request = mockRequest();
        String serviceInstanceId="1";
         ResponseBody result=null;
-        VfcService vfcService = mock(VfcService.class);
-        //when(vfcService.instantiateNetworkServiceInstance(anyObject(),serviceInstanceId)).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        //when(vfcClient.instantiateNetworkServiceInstance(anyObject(),serviceInstanceId)).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         service.instantiateNetworkServiceInstance(request,serviceInstanceId);
     }
@@ -807,9 +807,9 @@ public class DefaultPackageDistributionServiceTest {
     public void instantiateNetworkServiceInstanceWillThrowExceptionWhenVFCIsNotAvailable() throws IOException {
        HttpServletRequest request = mockRequest();
        String serviceInstanceId="1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.instantiateNetworkServiceInstance(Mockito.any(),eq(serviceInstanceId))).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.instantiateNetworkServiceInstance(Mockito.any(),eq(serviceInstanceId))).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.instantiateNetworkServiceInstance(request,serviceInstanceId);
     }
 
@@ -817,9 +817,9 @@ public class DefaultPackageDistributionServiceTest {
     public void instantiateNetworkServiceInstanceWillThrowExceptionWhenVFCResponseError() throws IOException {
        HttpServletRequest request = mockRequest();
        String serviceInstanceId="1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.instantiateNetworkServiceInstance(Mockito.any(),eq(serviceInstanceId))).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.instantiateNetworkServiceInstance(Mockito.any(),eq(serviceInstanceId))).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.instantiateNetworkServiceInstance(request,serviceInstanceId);
     }
 
@@ -830,9 +830,9 @@ public class DefaultPackageDistributionServiceTest {
         String csarId = "1";
         ResponseBody result=null;
         Job job = new Job();
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.terminateNetworkServiceInstance(eq(csarId),Mockito.any())).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.terminateNetworkServiceInstance(eq(csarId),Mockito.any())).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         service.terminateNetworkServiceInstance(request,csarId);
     }
@@ -841,9 +841,9 @@ public class DefaultPackageDistributionServiceTest {
     public void terminateNetworkServiceInstanceWillThrowExceptionWhenVFCIsNotAvailable() throws IOException {
        HttpServletRequest request = mockRequest();
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        //when(vfcService.terminateNetworkServiceInstance(csarId,anyObject())).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        //when(vfcClient.terminateNetworkServiceInstance(csarId,anyObject())).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.terminateNetworkServiceInstance(request,csarId);
     }
 
@@ -851,9 +851,9 @@ public class DefaultPackageDistributionServiceTest {
     public void terminateNetworkServiceInstanceWillThrowExceptionWhenVFCResponseError() throws IOException {
        HttpServletRequest request = mockRequest();
         String csarId = "1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.terminateNetworkServiceInstance(eq(csarId),Mockito.any())).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.terminateNetworkServiceInstance(eq(csarId),Mockito.any())).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.terminateNetworkServiceInstance(request,csarId);
     }
 
@@ -861,9 +861,9 @@ public class DefaultPackageDistributionServiceTest {
     public void itCreateNetworkServiceData() throws IOException {
        HttpServletRequest request = mockRequest();
         ResponseBody responseBody = null;
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.createNetworkServiceData(Mockito.any())).thenReturn(successfulCall(responseBody));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.createNetworkServiceData(Mockito.any())).thenReturn(successfulCall(responseBody));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         String result = service.createNetworkServiceData(request);
         assertNotNull(result);
@@ -873,18 +873,18 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void createNetworkServiceDataWillThrowExceptionWhenVFCIsNotAvailable() throws IOException {
        HttpServletRequest request = mockRequest();
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.createNetworkServiceData(Mockito.any())).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.createNetworkServiceData(Mockito.any())).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.createNetworkServiceData(request);
     }
 
     @Test
     public void createNetworkServiceDataWillThrowExceptionWhenVFCResponseError() throws IOException {
        HttpServletRequest request = mockRequest();
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.createNetworkServiceData(Mockito.any())).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.createNetworkServiceData(Mockito.any())).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.createNetworkServiceData(request);
     }
 
@@ -892,9 +892,9 @@ public class DefaultPackageDistributionServiceTest {
     public void itCreateVnfData() throws IOException {
        HttpServletRequest request = mockRequest();
         ResponseBody result=null;
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.createVnfData(Mockito.any())).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.createVnfData(Mockito.any())).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame("{\"status\":\"FAILED\"}", service.createVnfData(request));
     }
@@ -902,18 +902,18 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void createVnfDataWillThrowExceptionWhenVFCIsNotAvailable() throws IOException {
        HttpServletRequest request = mockRequest();
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.createVnfData(Mockito.any())).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.createVnfData(Mockito.any())).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.createVnfData(request);
     }
 
     @Test
     public void createVnfDataWillThrowExceptionWhenVFCResponseError() throws IOException {
        HttpServletRequest request = mockRequest();
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.createVnfData(Mockito.any())).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.createVnfData(Mockito.any())).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.createVnfData(request);
     }
 
@@ -921,9 +921,9 @@ public class DefaultPackageDistributionServiceTest {
     public void itCreatePnfData() throws IOException {
        HttpServletRequest request = mockRequest();
         ResponseBody result=null;
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.createPnfData(Mockito.any())).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.createPnfData(Mockito.any())).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame("{\"status\":\"FAILED\"}", service.createPnfData(request));
     }
@@ -931,18 +931,18 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void createPnfDataWillThrowExceptionWhenVFCIsNotAvailable() throws IOException {
        HttpServletRequest request = mockRequest();
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.createPnfData(Mockito.any())).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.createPnfData(Mockito.any())).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.createPnfData(request);
     }
 
     @Test
     public void createPnfDataWillThrowExceptionWhenVFCResponseError() throws IOException {
        HttpServletRequest request = mockRequest();
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.createPnfData(Mockito.any())).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.createPnfData(Mockito.any())).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.createPnfData(request);
     }
 
@@ -950,9 +950,9 @@ public class DefaultPackageDistributionServiceTest {
     public void itGetNsdInfo() throws IOException {
        String nsdId="1";
         ResponseBody result=null;
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getNsdInfo(nsdId)).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getNsdInfo(nsdId)).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame("{\"status\":\"SUCCESS\"}", service.getNsdInfo(nsdId));
     }
@@ -960,18 +960,18 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void getNsdInfoWillThrowExceptionWhenVFCIsNotAvailable() throws IOException {
        String nsdId="1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getNsdInfo(nsdId)).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getNsdInfo(nsdId)).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.getNsdInfo(nsdId);
     }
 
     @Test
     public void getNsdInfoWillThrowExceptionWhenVFCResponseError() throws IOException {
        String nsdId="1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getNsdInfo(nsdId)).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getNsdInfo(nsdId)).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.getNsdInfo(nsdId);
     }
 
@@ -979,9 +979,9 @@ public class DefaultPackageDistributionServiceTest {
     public void itGetVnfInfo() throws IOException {
        String nsdId="1";
         ResponseBody result=null;
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getVnfInfo(nsdId)).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getVnfInfo(nsdId)).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame("{\"status\":\"SUCCESS\"}", service.getVnfInfo(nsdId));
     }
@@ -989,18 +989,18 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void getVnfInfoWillThrowExceptionWhenVFCIsNotAvailable() throws IOException {
        String nsdId="1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getVnfInfo(nsdId)).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getVnfInfo(nsdId)).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.getVnfInfo(nsdId);
     }
 
     @Test
     public void getVnfInfoWillThrowExceptionWhenVFCResponseError() throws IOException {
        String nsdId="1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getVnfInfo(nsdId)).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getVnfInfo(nsdId)).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.getVnfInfo(nsdId);
     }
 
@@ -1008,9 +1008,9 @@ public class DefaultPackageDistributionServiceTest {
     public void itGetPnfInfo() throws IOException {
        String nsdId="1";
         ResponseBody result=null;
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getPnfInfo(nsdId)).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getPnfInfo(nsdId)).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame("{\"status\":\"SUCCESS\"}", service.getPnfInfo(nsdId));
     }
@@ -1018,52 +1018,52 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void getPnfInfoWillThrowExceptionWhenVFCIsNotAvailable() throws IOException {
        String nsdId="1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getPnfInfo(nsdId)).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getPnfInfo(nsdId)).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.getPnfInfo(nsdId);
     }
 
     @Test
     public void getPnfInfoWillThrowExceptionWhenVFCResponseError() throws IOException {
        String nsdId="1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getPnfInfo(nsdId)).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getPnfInfo(nsdId)).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.getPnfInfo(nsdId);
     }
 
     @Test
     public void itCanListNsTemplates() throws IOException {
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.listNsTemplates()).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.listNsTemplates()).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertNotNull( service.listNsTemplates());
     }
 
     @Test
     public void listNsTemplatesWillThrowExceptionWhenVFCIsNotAvailable() throws IOException {
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.listNsTemplates()).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.listNsTemplates()).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.listNsTemplates();
     }
 
     @Test
     public void listNsTemplatesWillThrowExceptionWhenVFCResponseError() throws IOException {
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.listNsTemplates()).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.listNsTemplates()).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.listNsTemplates();
     }
 
     @Test
     public void itCanGetVnfInfoById() throws IOException {
        String nsdId="1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getVnfInfoById(nsdId)).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getVnfInfoById(nsdId)).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertNotNull(service.getVnfInfoById(nsdId));
     }
@@ -1071,18 +1071,18 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void getVnfInfoByIdWillThrowExceptionWhenVFCIsNotAvailable() throws IOException {
        String nsdId="1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getVnfInfoById(nsdId)).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getVnfInfoById(nsdId)).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.getVnfInfoById(nsdId);
     }
 
     @Test
     public void getVnfInfoByIdWillThrowExceptionWhenVFCResponseError() throws IOException {
        String nsdId="1";
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.getVnfInfoById(nsdId)).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.getVnfInfoById(nsdId)).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.getVnfInfoById(nsdId);
     }
 
@@ -1090,9 +1090,9 @@ public class DefaultPackageDistributionServiceTest {
     public void itCanFetchNsTemplateData() throws IOException {
        HttpServletRequest request = mockRequest();
         ResponseBody result=null;
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.fetchNsTemplateData(Mockito.any())).thenReturn(successfulCall(result));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.fetchNsTemplateData(Mockito.any())).thenReturn(successfulCall(result));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
 
         Assert.assertSame("{\"status\":\"FAILED\"}", service.fetchNsTemplateData(request));
     }
@@ -1100,18 +1100,18 @@ public class DefaultPackageDistributionServiceTest {
     @Test
     public void fetchNsTemplateDataWillThrowExceptionWhenVFCIsNotAvailable() throws IOException {
        HttpServletRequest request = mockRequest();
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.fetchNsTemplateData(Mockito.any())).thenReturn(failedCall("VFC is not available!"));
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.fetchNsTemplateData(Mockito.any())).thenReturn(failedCall("VFC is not available!"));
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.fetchNsTemplateData(request);
     }
 
     @Test
     public void fetchNsTemplateDataWillThrowExceptionWhenVFCResponseError() throws IOException {
        HttpServletRequest request = mockRequest();
-        VfcService vfcService = mock(VfcService.class);
-        when(vfcService.fetchNsTemplateData(Mockito.any())).thenReturn(emptyBodyCall());
-        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcService, null);
+        VfcClient vfcClient = mock(VfcClient.class);
+        when(vfcClient.fetchNsTemplateData(Mockito.any())).thenReturn(emptyBodyCall());
+        PackageDistributionService service = new DefaultPackageDistributionService(null, vfcClient, null);
         service.fetchNsTemplateData(request);
     }
 
index e04d7e3..df7cea2 100644 (file)
@@ -20,7 +20,7 @@ import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
 import org.onap.usecaseui.server.service.lcm.ServiceLcmService;
-import org.onap.usecaseui.server.service.lcm.domain.so.SOService;
+import org.onap.usecaseui.server.service.lcm.domain.so.SOClient;
 import org.onap.usecaseui.server.service.lcm.domain.so.bean.DeleteOperationRsp;
 import org.onap.usecaseui.server.service.lcm.domain.so.bean.Operation;
 import org.onap.usecaseui.server.service.lcm.domain.so.bean.OperationProgressInformation;
@@ -51,24 +51,24 @@ public class DefaultServiceLcmServiceTest {
 
        @Before
        public void before() throws Exception {
-               SOService soService = mock(SOService.class);
-               service = new DefaultServiceLcmService(entityManagerFactory, soService);
+               SOClient soClient = mock(SOClient.class);
+               service = new DefaultServiceLcmService(entityManagerFactory, soClient);
 
        }
 
     @Test
     public void itCanInstantiateService() throws IOException {
-        SOService soService = mock(SOService.class);
+        SOClient soClient = mock(SOClient.class);
         Operation op = new Operation();
         op.setOperationId("1");
         op.setServiceId("1");
         ServiceOperation operation = new ServiceOperation();
         operation.setService(op);
-        when(soService.instantiateService(Mockito.any())).thenReturn(successfulCall(operation));
+        when(soClient.instantiateService(Mockito.any())).thenReturn(successfulCall(operation));
 
         HttpServletRequest request = mockRequest();
 
-        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soService);
+        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soClient);
 
         Assert.assertSame(operation, service.instantiateService(request));
     }
@@ -103,175 +103,175 @@ public class DefaultServiceLcmServiceTest {
 
     @Test(expected = SOException.class)
     public void instantiateServiceWillThrowExceptionWhenSOIsNotAvailable() throws IOException {
-        SOService soService = mock(SOService.class);
-        when(soService.instantiateService(Mockito.any())).thenReturn(failedCall("SO is not available!"));
+        SOClient soClient = mock(SOClient.class);
+        when(soClient.instantiateService(Mockito.any())).thenReturn(failedCall("SO is not available!"));
         HttpServletRequest request = mockRequest();
 
-        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soService);
+        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soClient);
 
         service.instantiateService(request);
     }
 
     @Test(expected = SOException.class)
     public void instantiateServiceWillThrowExceptionWhenSOResponseError() throws IOException {
-        SOService soService = mock(SOService.class);
-        when(soService.instantiateService(Mockito.any())).thenReturn(emptyBodyCall());
+        SOClient soClient = mock(SOClient.class);
+        when(soClient.instantiateService(Mockito.any())).thenReturn(emptyBodyCall());
         HttpServletRequest request = mockRequest();
 
-        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soService);
+        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soClient);
 
         service.instantiateService(request);
     }
 
     @Test
     public void itCanTerminateService() throws IOException {
-        SOService soService = mock(SOService.class);
+        SOClient soClient = mock(SOClient.class);
         String serviceId = "1";
         DeleteOperationRsp rsp = new DeleteOperationRsp();
         rsp.setOperationId("1");
-        when(soService.terminateService(eq(serviceId), Mockito.any())).thenReturn(successfulCall(rsp));
+        when(soClient.terminateService(eq(serviceId), Mockito.any())).thenReturn(successfulCall(rsp));
         HttpServletRequest request = mockRequest();
 
-        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soService);
+        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soClient);
 
         Assert.assertSame(rsp, service.terminateService(serviceId, request));
     }
 
     @Test(expected = SOException.class)
     public void terminateServiceWillThrowExceptionWhenSOIsNotAvailable() throws IOException {
-        SOService soService = mock(SOService.class);
+        SOClient soClient = mock(SOClient.class);
         String serviceId = "1";
-        when(soService.terminateService(eq(serviceId), Mockito.any())).thenReturn(failedCall("SO is not available!"));
+        when(soClient.terminateService(eq(serviceId), Mockito.any())).thenReturn(failedCall("SO is not available!"));
         HttpServletRequest request = mockRequest();
 
-        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soService);
+        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soClient);
 
         service.terminateService(serviceId, request);
     }
 
     @Test(expected = SOException.class)
     public void terminateServiceWillThrowExceptionWhenSOResponseError() throws IOException {
-        SOService soService = mock(SOService.class);
+        SOClient soClient = mock(SOClient.class);
         String serviceId = "1";
-        when(soService.terminateService(eq(serviceId), Mockito.any())).thenReturn(emptyBodyCall());
+        when(soClient.terminateService(eq(serviceId), Mockito.any())).thenReturn(emptyBodyCall());
         HttpServletRequest request = mockRequest();
 
-        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soService);
+        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soClient);
 
         service.terminateService(serviceId, request);
     }
 
     @Test
     public void itCanQueryOperationProgress() {
-        SOService soService = mock(SOService.class);
+        SOClient soClient = mock(SOClient.class);
         String serviceId = "1";
         String operationId = "1";
         OperationProgressInformation progress = new OperationProgressInformation();
-        when(soService.queryOperationProgress(serviceId, operationId)).thenReturn(successfulCall(progress));
+        when(soClient.queryOperationProgress(serviceId, operationId)).thenReturn(successfulCall(progress));
 
-        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soService);
+        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soClient);
 
         Assert.assertSame(progress, service.queryOperationProgress(serviceId, operationId));
     }
 
     @Test(expected = SOException.class)
     public void queryOperationProgressWillThrowExceptionWhenSOIsNotAvailable() {
-        SOService soService = mock(SOService.class);
+        SOClient soClient = mock(SOClient.class);
         String serviceId = "1";
         String operationId = "1";
-        when(soService.queryOperationProgress(serviceId, operationId)).thenReturn(failedCall("SO is not available!"));
+        when(soClient.queryOperationProgress(serviceId, operationId)).thenReturn(failedCall("SO is not available!"));
 
-        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soService);
+        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soClient);
 
         service.queryOperationProgress(serviceId, operationId);
     }
 
     @Test(expected = SOException.class)
     public void queryOperationProgressWillThrowExceptionWhenSOResponseError() {
-        SOService soService = mock(SOService.class);
+        SOClient soClient = mock(SOClient.class);
         String serviceId = "1";
         String operationId = "1";
-        when(soService.queryOperationProgress(serviceId, operationId)).thenReturn(emptyBodyCall());
+        when(soClient.queryOperationProgress(serviceId, operationId)).thenReturn(emptyBodyCall());
 
-        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soService);
+        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soClient);
 
         service.queryOperationProgress(serviceId, operationId);
     }
 
     @Test(expected = SOException.class)
     public void scaleServiceWillThrowExceptionWhenSOIsNotAvailable() throws IOException {
-        SOService soService = mock(SOService.class);
+        SOClient soClient = mock(SOClient.class);
         String serviceId = "1";
-        when(soService.scaleService(eq(serviceId), Mockito.any())).thenReturn(failedCall("SO is not available!"));
+        when(soClient.scaleService(eq(serviceId), Mockito.any())).thenReturn(failedCall("SO is not available!"));
         HttpServletRequest request = mockRequest();
 
-        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soService);
+        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soClient);
 
         service.scaleService(serviceId, request);
     }
 
     @Test(expected = SOException.class)
     public void scaleServiceWillThrowExceptionWhenSOResponseError() throws IOException {
-        SOService soService = mock(SOService.class);
+        SOClient soClient = mock(SOClient.class);
         String serviceId = "1";
-        when(soService.scaleService(eq(serviceId), Mockito.any())).thenReturn(emptyBodyCall());
+        when(soClient.scaleService(eq(serviceId), Mockito.any())).thenReturn(emptyBodyCall());
         HttpServletRequest request = mockRequest();
 
-        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soService);
+        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soClient);
 
         service.scaleService(serviceId, request);
     }
 
     @Test
     public void itCanScaleService() throws IOException {
-        SOService soService = mock(SOService.class);
+        SOClient soClient = mock(SOClient.class);
         String serviceId = "1";
         SaveOrUpdateOperationRsp rsp = new SaveOrUpdateOperationRsp();
         rsp.setOperationId("1");
-        when(soService.scaleService(eq(serviceId), Mockito.any())).thenReturn(successfulCall(rsp));
+        when(soClient.scaleService(eq(serviceId), Mockito.any())).thenReturn(successfulCall(rsp));
         HttpServletRequest request = mockRequest();
 
-        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soService);
+        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soClient);
 
         Assert.assertSame(rsp, service.scaleService(serviceId, request));
     }
 
     @Test(expected = SOException.class)
     public void updateServiceWillThrowExceptionWhenSOIsNotAvailable() throws IOException {
-        SOService soService = mock(SOService.class);
+        SOClient soClient = mock(SOClient.class);
         String serviceId = "1";
-        when(soService.updateService(eq(serviceId), Mockito.any())).thenReturn(failedCall("SO is not available!"));
+        when(soClient.updateService(eq(serviceId), Mockito.any())).thenReturn(failedCall("SO is not available!"));
         HttpServletRequest request = mockRequest();
 
-        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soService);
+        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soClient);
 
         service.updateService(serviceId, request);
     }
 
     @Test(expected = SOException.class)
     public void updateServiceWillThrowExceptionWhenSOResponseError() throws IOException {
-        SOService soService = mock(SOService.class);
+        SOClient soClient = mock(SOClient.class);
 
         String serviceId = "1";
-        when(soService.updateService(eq(serviceId), Mockito.any())).thenReturn(emptyBodyCall());
+        when(soClient.updateService(eq(serviceId), Mockito.any())).thenReturn(emptyBodyCall());
         HttpServletRequest request = mockRequest();
 
-        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soService);
+        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soClient);
 
         service.updateService(serviceId, request);
     }
 
     @Test
     public void itCanUpdateService() throws IOException {
-        SOService soService = mock(SOService.class);
+        SOClient soClient = mock(SOClient.class);
         EntityManagerFactory entityManagerFactory = mock(EntityManagerFactory.class);
         String serviceId = "1";
         SaveOrUpdateOperationRsp rsp = new SaveOrUpdateOperationRsp();
         rsp.setOperationId("1");
-        when(soService.updateService(eq(serviceId), Mockito.any())).thenReturn(successfulCall(rsp));
+        when(soClient.updateService(eq(serviceId), Mockito.any())).thenReturn(successfulCall(rsp));
         HttpServletRequest request = mockRequest();
 
-        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soService);
+        ServiceLcmService service = new DefaultServiceLcmService(entityManagerFactory, soClient);
 
         Assert.assertSame(rsp, service.updateService(serviceId, request));
     }
index 9b10b06..6c11382 100644 (file)
@@ -68,7 +68,7 @@ public class DefaultServiceTemplateServiceIntegrationTest {
     @SneakyThrows
     void thatSDCCatalogRequestsAreCorrect() {
         stubFor(
-            get(urlPathEqualTo("/api/sdc/v1/catalog/services"))
+            get(urlPathEqualTo("/v1/catalog/services"))
             .withQueryParam("category", equalTo("E2E Service"))
             .withQueryParam("distributionStatus", equalTo("DISTRIBUTED"))
             .withBasicAuth(username, password)
index 8c9accf..4f20ba0 100644 (file)
@@ -32,7 +32,7 @@ import org.onap.usecaseui.server.service.lcm.domain.aai.bean.SDNCControllerRsp;
 import org.onap.usecaseui.server.service.lcm.domain.aai.bean.VimInfo;
 import org.onap.usecaseui.server.service.lcm.domain.aai.bean.VimInfoRsp;
 import org.onap.usecaseui.server.service.lcm.domain.aai.exceptions.AAIException;
-import org.onap.usecaseui.server.service.lcm.domain.sdc.SDCCatalogService;
+import org.onap.usecaseui.server.service.lcm.domain.sdc.SDCCatalogClient;
 import org.onap.usecaseui.server.service.lcm.domain.sdc.bean.SDCServiceTemplate;
 import org.onap.usecaseui.server.service.lcm.domain.sdc.exceptions.SDCCatalogException;
 import org.openecomp.sdc.toscaparser.api.NodeTemplate;
@@ -59,7 +59,7 @@ public class DefaultServiceTemplateServiceTest {
     @Test
     public void itCanListDistributedServiceTemplate() {
         List<SDCServiceTemplate> templates = Collections.singletonList(new SDCServiceTemplate("uuid", "uuid", "name", "V1","url", "category"));
-        SDCCatalogService sdcService = mock(SDCCatalogService.class);
+        SDCCatalogClient sdcService = mock(SDCCatalogClient.class);
         when(sdcService.listServices(CATEGORY_E2E_SERVICE, DISTRIBUTION_STATUS_DISTRIBUTED)).thenReturn(successfulCall(templates));
 
         ServiceTemplateService service = new DefaultServiceTemplateService(sdcService,null);
@@ -69,7 +69,7 @@ public class DefaultServiceTemplateServiceTest {
 
     @Test(expected = SDCCatalogException.class)
     public void retrieveServiceWillThrowExceptionWhenSDCIsNotAvailable() {
-        SDCCatalogService sdcService = mock(SDCCatalogService.class);
+        SDCCatalogClient sdcService = mock(SDCCatalogClient.class);
         when(sdcService.listServices(CATEGORY_E2E_SERVICE, DISTRIBUTION_STATUS_DISTRIBUTED)).thenReturn(failedCall("SDC is not available!"));
 
         ServiceTemplateService service = new DefaultServiceTemplateService(sdcService,null);
@@ -78,7 +78,7 @@ public class DefaultServiceTemplateServiceTest {
 
     @Test
     public void itWillRetrieveEmptyWhenNoServiceTemplateCanGet() {
-        SDCCatalogService sdcService = mock(SDCCatalogService.class);
+        SDCCatalogClient sdcService = mock(SDCCatalogClient.class);
         when(sdcService.listServices(CATEGORY_E2E_SERVICE, DISTRIBUTION_STATUS_DISTRIBUTED)).thenReturn(emptyBodyCall());
 
         ServiceTemplateService service = new DefaultServiceTemplateService(sdcService,null);
@@ -93,7 +93,7 @@ public class DefaultServiceTemplateServiceTest {
         String modelPath = "model_path";
         String nodeUUID = "2";
 
-        SDCCatalogService sdcService = newSdcCatalogService(nodeUUID);
+        SDCCatalogClient sdcService = newSdcCatalogService(nodeUUID);
 
         List<VimInfo> vim = Collections.singletonList(new VimInfo("owner", "regionId"));
         AAIClient aaiClient = newAAIService(vim);
@@ -102,7 +102,7 @@ public class DefaultServiceTemplateServiceTest {
 
         Assert.assertNotNull(service.fetchServiceTemplateInput(uuid, modelPath));    }
 
-    private DefaultServiceTemplateService newServiceTemplateService(String uuid, String nodeUUID, SDCCatalogService sdcService, AAIClient aaiClient) {
+    private DefaultServiceTemplateService newServiceTemplateService(String uuid, String nodeUUID, SDCCatalogClient sdcService, AAIClient aaiClient) {
         return new DefaultServiceTemplateService(sdcService, aaiClient) {
 
             @Override
@@ -120,8 +120,8 @@ public class DefaultServiceTemplateServiceTest {
         };
     }
 
-    private SDCCatalogService newSdcCatalogService(String nodeUUID) throws IOException {
-        SDCCatalogService sdcService = mock(SDCCatalogService.class);
+    private SDCCatalogClient newSdcCatalogService(String nodeUUID) throws IOException {
+        SDCCatalogClient sdcService = mock(SDCCatalogClient.class);
         when(sdcService.getService(nodeUUID)).thenReturn(successfulCall(new SDCServiceTemplate(nodeUUID, nodeUUID, "node", "V1", "nodeModelUrl", "service")));
         return sdcService;
     }
@@ -293,7 +293,7 @@ public class DefaultServiceTemplateServiceTest {
     }
     @Test
     public void testDownloadFile() throws IOException {
-        SDCCatalogService sdcService = mock(SDCCatalogService.class);
+        SDCCatalogClient sdcService = mock(SDCCatalogClient.class);
         ResponseBody result= new ResponseBody() {
             @Nullable
             @Override
index 7c5f409..e6e0826 100644 (file)
@@ -33,7 +33,7 @@ import org.junit.Test;
 import org.onap.usecaseui.server.bean.lcm.sotne2eservice.E2EServiceInstanceRequest;
 import org.onap.usecaseui.server.bean.lcm.sotne2eservice.ModelConfig;
 import org.onap.usecaseui.server.service.lcm.domain.aai.AAIClient;
-import org.onap.usecaseui.server.service.lcm.domain.so.SOService;
+import org.onap.usecaseui.server.service.lcm.domain.so.SOClient;
 import org.onap.usecaseui.server.service.lcm.domain.so.bean.DeleteOperationRsp;
 import org.onap.usecaseui.server.service.lcm.domain.so.bean.ServiceOperation;
 import retrofit2.Call;
@@ -55,16 +55,16 @@ import static org.onap.usecaseui.server.util.CallStub.failedCall;
 public class SotnServiceTemplateServiceImplTest {
 
     AAIClient aaiClient;
-    SOService soService;
+    SOClient soClient;
     ServiceOperation serviceOperation;
     SotnServiceTemplateServiceImpl sotnServiceTemplateService;
 
     @Before
     public void before() throws Exception {
         aaiClient = mock(AAIClient.class);
-        soService = mock(SOService.class);
+        soClient = mock(SOClient.class);
         sotnServiceTemplateService = new SotnServiceTemplateServiceImpl();
-        sotnServiceTemplateService.setSoService(soService);
+        sotnServiceTemplateService.setSoClient(soClient);
         sotnServiceTemplateService.setAaiClient(aaiClient);
     }
 
@@ -77,7 +77,7 @@ public class SotnServiceTemplateServiceImplTest {
         map.put("l2vpn","34");
         map.put("sotnUni","45");
         Call<ServiceOperation> call = getSosCall();
-        when(soService.instantiateSOTNService(any(E2EServiceInstanceRequest.class))).thenReturn(call);
+        when(soClient.instantiateSOTNService(any(E2EServiceInstanceRequest.class))).thenReturn(call);
         sotnServiceTemplateService.instantiate_CCVPN_Service(map);
     }
 
@@ -89,21 +89,21 @@ public class SotnServiceTemplateServiceImplTest {
         map.put("l2vpn","34");
         map.put("sotnUni","45");
         Call<ServiceOperation> call = getSosCall();
-        when(soService.instantiateSOTNService(any(E2EServiceInstanceRequest.class))).thenReturn(call);
+        when(soClient.instantiateSOTNService(any(E2EServiceInstanceRequest.class))).thenReturn(call);
         sotnServiceTemplateService.instantiate_CCVPN_Service(map);
     }
 
     @Test
     public void createSotnServiceTest() {
         Call<ServiceOperation> call = getSosCall();
-        when(soService.instantiateSOTNService(any(E2EServiceInstanceRequest.class))).thenReturn(call);
+        when(soClient.instantiateSOTNService(any(E2EServiceInstanceRequest.class))).thenReturn(call);
         sotnServiceTemplateService.createSotnService(new E2EServiceInstanceRequest());
     }
 
     @Test
     public void createSotnServiceWithThrowException() {
         Call<ServiceOperation> call = getSosCall();
-        when(soService.instantiateSOTNService(any(E2EServiceInstanceRequest.class))).thenReturn(call);
+        when(soClient.instantiateSOTNService(any(E2EServiceInstanceRequest.class))).thenReturn(call);
         sotnServiceTemplateService.createSotnService(new E2EServiceInstanceRequest());
     }
 
@@ -330,7 +330,7 @@ public class SotnServiceTemplateServiceImplTest {
         Response result = null;
         RequestBody requestBody = null;
         when(aaiClient.getServiceInstancesForEdge(anyString(),anyString(),anyString())).thenReturn(aaiCall);
-        when(soService.terminateService(anyString(),any(RequestBody.class))).thenReturn(sosCall);
+        when(soClient.terminateService(anyString(),any(RequestBody.class))).thenReturn(sosCall);
         sotnServiceTemplateService.deleteService("NNI-001", "vpn-bind-1");
     }
     @Test
@@ -340,7 +340,7 @@ public class SotnServiceTemplateServiceImplTest {
         Response result = null;
         RequestBody requestBody = null;
         when(aaiClient.getServiceInstancesForEdge("ISAAC", "example-service-type-val-52265", "NNI-001")).thenReturn(aaiCall);
-        when(soService.terminateService("serviceId",requestBody)).thenReturn(failedCall("failed to delete the server."));
+        when(soClient.terminateService("serviceId",requestBody)).thenReturn(failedCall("failed to delete the server."));
         sotnServiceTemplateService.deleteService("NNI-001", "vpn-bind-1");
     }
     @Test
index 47a50fe..6abfd1b 100644 (file)
@@ -51,13 +51,13 @@ import org.onap.usecaseui.server.service.slicingdomain.aai.bean.AAIServiceProfil
 import org.onap.usecaseui.server.service.slicingdomain.aai.bean.AAIServiceRsp;
 import org.onap.usecaseui.server.service.slicingdomain.aai.bean.Relationship;
 import org.onap.usecaseui.server.service.slicingdomain.aai.bean.RelationshipData;
-import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceService;
+import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceClient;
 import org.powermock.api.support.membermodification.MemberModifier;
 
 public class ResourceMgtServiceConvertTest {
 
     ResourceMgtServiceConvert resourceMgtServiceConvert = null;
-    SOSliceService soSliceService = null;
+    SOSliceClient soSliceClient = null;
     AAISliceClient aaiSliceClient = null;
 
     GeneralConvertImpl generalConvert;
index 407cdc7..e4b05ab 100644 (file)
@@ -29,7 +29,7 @@ import org.junit.Test;
 import org.onap.usecaseui.server.constant.nsmf.NsmfParamConstant;
 import org.onap.usecaseui.server.service.slicingdomain.aai.AAISliceClient;
 import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.NetworkInfo;
-import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceService;
+import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceClient;
 import org.onap.usecaseui.server.service.slicingdomain.so.bean.ActivateService;
 import org.onap.usecaseui.server.service.slicingdomain.so.bean.SOOperation;
 import retrofit2.Call;
@@ -37,14 +37,14 @@ import retrofit2.Call;
 public class ResourceMgtServiceImplTest {
 
     ResourceMgtServiceImpl resourceMgtService = null;
-    SOSliceService soSliceService;
+    SOSliceClient soSliceClient;
     AAISliceClient aaiSliceClient;
 
     @Before
     public void before() throws Exception {
         aaiSliceClient = mock(AAISliceClient.class);
-        soSliceService = mock(SOSliceService.class);
-        resourceMgtService = new ResourceMgtServiceImpl(aaiSliceClient, soSliceService);
+        soSliceClient = mock(SOSliceClient.class);
+        resourceMgtService = new ResourceMgtServiceImpl(aaiSliceClient, soSliceClient);
     }
 
     @Test
@@ -368,7 +368,7 @@ public class ResourceMgtServiceImplTest {
         RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonstr.toString());
 
         ActivateService activateService = new ActivateService();
-        when(soSliceService.activeService(serviceId, requestBody))
+        when(soSliceClient.activeService(serviceId, requestBody))
             .thenReturn(successfulCall(activateService));
         resourceMgtService.activateSlicingService(serviceId);
     }
@@ -379,7 +379,7 @@ public class ResourceMgtServiceImplTest {
         String serviceId = "23er-56ty-4567-rgdf5";
         String jsonstr = "testJson";
         RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonstr.toString());
-        when(soSliceService.activeService(serviceId, requestBody))
+        when(soSliceClient.activeService(serviceId, requestBody))
             .thenReturn(failedCall("so is not exist!"));
         resourceMgtService.activateSlicingService(serviceId);
     }
@@ -391,7 +391,7 @@ public class ResourceMgtServiceImplTest {
         RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonstr.toString());
         Call<ActivateService> call = emptyBodyCall();
 
-        when(soSliceService.activeService(serviceId, requestBody)).thenReturn(call);
+        when(soSliceClient.activeService(serviceId, requestBody)).thenReturn(call);
         resourceMgtService.activateSlicingService(serviceId);
     }
 
@@ -401,7 +401,7 @@ public class ResourceMgtServiceImplTest {
 
         ActivateService activateService = new ActivateService();
         RequestBody requestBody = null;
-        when(soSliceService.deactiveService(serviceId, requestBody))
+        when(soSliceClient.deactiveService(serviceId, requestBody))
             .thenReturn(successfulCall(activateService));
         resourceMgtService.deactivateSlicingService(serviceId);
     }
@@ -411,7 +411,7 @@ public class ResourceMgtServiceImplTest {
 
         String serviceId = "23er-56ty-4567-rgdf5";
         RequestBody requestBody = null;
-        when(soSliceService.deactiveService(serviceId, requestBody))
+        when(soSliceClient.deactiveService(serviceId, requestBody))
             .thenReturn(failedCall("so is not exist!"));
         resourceMgtService.deactivateSlicingService(serviceId);
     }
@@ -423,7 +423,7 @@ public class ResourceMgtServiceImplTest {
         RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonstr.toString());
         Call<ActivateService> call = emptyBodyCall();
 
-        when(soSliceService.deactiveService(serviceId, requestBody)).thenReturn(call);
+        when(soSliceClient.deactiveService(serviceId, requestBody)).thenReturn(call);
         resourceMgtService.deactivateSlicingService(serviceId);
     }
 
@@ -433,7 +433,7 @@ public class ResourceMgtServiceImplTest {
 
         ActivateService activateService = new ActivateService();
         RequestBody requestBody = null;
-        when(soSliceService.terminateService(serviceId, requestBody))
+        when(soSliceClient.terminateService(serviceId, requestBody))
             .thenReturn(successfulCall(activateService));
         resourceMgtService.terminateSlicingService(serviceId);
     }
@@ -443,7 +443,7 @@ public class ResourceMgtServiceImplTest {
 
         String serviceId = "23er-56ty-4567-rgdf5";
         RequestBody requestBody = null;
-        when(soSliceService.terminateService(serviceId, requestBody))
+        when(soSliceClient.terminateService(serviceId, requestBody))
             .thenReturn(failedCall("so is not exist!"));
         resourceMgtService.terminateSlicingService(serviceId);
     }
@@ -455,7 +455,7 @@ public class ResourceMgtServiceImplTest {
         RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonstr.toString());
         Call<ActivateService> call = emptyBodyCall();
 
-        when(soSliceService.terminateService(serviceId, requestBody)).thenReturn(call);
+        when(soSliceClient.terminateService(serviceId, requestBody)).thenReturn(call);
         resourceMgtService.terminateSlicingService(serviceId);
     }
 
@@ -465,7 +465,7 @@ public class ResourceMgtServiceImplTest {
         String operationId = "2345-5675-3456-er45";
         SOOperation soOperation = new SOOperation();
 
-        when(soSliceService.queryOperationProgress(serviceId, operationId))
+        when(soSliceClient.queryOperationProgress(serviceId, operationId))
             .thenReturn(successfulCall(soOperation));
         resourceMgtService.queryOperationProgress(serviceId);
     }
@@ -476,7 +476,7 @@ public class ResourceMgtServiceImplTest {
         String serviceId = "23er-56ty-4567-rgdf5";
         String operationId = "2345-5675-3456-er45";
 
-        when(soSliceService.queryOperationProgress(serviceId, operationId))
+        when(soSliceClient.queryOperationProgress(serviceId, operationId))
             .thenReturn(failedCall("so is not exist!"));
         resourceMgtService.queryOperationProgress(serviceId);
     }
@@ -487,7 +487,7 @@ public class ResourceMgtServiceImplTest {
         String operationId = "2345-5675-3456-er45";
         Call<SOOperation> call = emptyBodyCall();
 
-        when(soSliceService.queryOperationProgress(serviceId, operationId)).thenReturn(call);
+        when(soSliceClient.queryOperationProgress(serviceId, operationId)).thenReturn(call);
         resourceMgtService.queryOperationProgress(serviceId);
     }
 }
index d03ee6b..17e3025 100644 (file)
@@ -27,7 +27,7 @@ import org.junit.Before;
 import org.junit.Test;
 import org.onap.usecaseui.server.bean.nsmf.monitor.ServiceInfo;
 import org.onap.usecaseui.server.bean.nsmf.monitor.ServiceList;
-import org.onap.usecaseui.server.service.slicingdomain.kpi.KpiSliceService;
+import org.onap.usecaseui.server.service.slicingdomain.kpi.KpiSliceClient;
 import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.KpiTotalBandwidth;
 import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.KpiTotalTraffic;
 import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.KpiUserNumber;
@@ -35,12 +35,12 @@ import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.KpiUserNumber;
 public class ResourceMonitorServiceImplTest {
 
     ResourceMonitorServiceImpl resourceMonitorService = null;
-    KpiSliceService kpiSliceService = null;
+    KpiSliceClient kpiSliceClient = null;
 
     @Before
     public void before() throws Exception {
-        kpiSliceService = mock(KpiSliceService.class);
-        resourceMonitorService = new ResourceMonitorServiceImpl(kpiSliceService);
+        kpiSliceClient = mock(KpiSliceClient.class);
+        resourceMonitorService = new ResourceMonitorServiceImpl(kpiSliceClient);
     }
 
     @Test
@@ -60,7 +60,7 @@ public class ResourceMonitorServiceImplTest {
 
         KpiTotalTraffic kpiTotalTraffic = new KpiTotalTraffic();
         RequestBody body = null;
-        when(kpiSliceService.listTotalTraffic(body)).thenReturn(successfulCall(kpiTotalTraffic));
+        when(kpiSliceClient.listTotalTraffic(body)).thenReturn(successfulCall(kpiTotalTraffic));
         resourceMonitorService.querySlicingUsageTraffic(queryTimestamp, serviceList);
     }
 
@@ -75,7 +75,7 @@ public class ResourceMonitorServiceImplTest {
         String queryTimestamp = "1577071879000";
 
         RequestBody body = null;
-        when(kpiSliceService.listTotalTraffic(body)).thenReturn(failedCall("kpi is not exist!"));
+        when(kpiSliceClient.listTotalTraffic(body)).thenReturn(failedCall("kpi is not exist!"));
         resourceMonitorService.querySlicingUsageTraffic(queryTimestamp, serviceList);
     }
 
@@ -91,7 +91,7 @@ public class ResourceMonitorServiceImplTest {
 
         KpiUserNumber kpiUserNumber = new KpiUserNumber();
         RequestBody body = null;
-        when(kpiSliceService.listUserNumber(body)).thenReturn(successfulCall(kpiUserNumber));
+        when(kpiSliceClient.listUserNumber(body)).thenReturn(successfulCall(kpiUserNumber));
         resourceMonitorService.querySlicingOnlineUserNumber(queryTimestamp, serviceList);
     }
 
@@ -106,7 +106,7 @@ public class ResourceMonitorServiceImplTest {
         String queryTimestamp = "1577071879000";
 
         RequestBody body = null;
-        when(kpiSliceService.listUserNumber(body)).thenReturn(failedCall("kpi is not exist!"));
+        when(kpiSliceClient.listUserNumber(body)).thenReturn(failedCall("kpi is not exist!"));
         resourceMonitorService.querySlicingOnlineUserNumber(queryTimestamp, serviceList);
     }
 
@@ -122,7 +122,7 @@ public class ResourceMonitorServiceImplTest {
 
         KpiTotalBandwidth kpiTotalBandwidth = new KpiTotalBandwidth();
         RequestBody body = null;
-        when(kpiSliceService.listTotalBandwidth(body)).thenReturn(successfulCall(kpiTotalBandwidth));
+        when(kpiSliceClient.listTotalBandwidth(body)).thenReturn(successfulCall(kpiTotalBandwidth));
         resourceMonitorService.querySlicingTotalBandwidth(queryTimestamp, serviceList);
     }
 
@@ -137,7 +137,7 @@ public class ResourceMonitorServiceImplTest {
         String queryTimestamp = "1577071879000";
 
         RequestBody body = null;
-        when(kpiSliceService.listTotalBandwidth(body)).thenReturn(failedCall("kpi is not exist!"));
+        when(kpiSliceClient.listTotalBandwidth(body)).thenReturn(failedCall("kpi is not exist!"));
         resourceMonitorService.querySlicingTotalBandwidth(queryTimestamp, serviceList);
     }
 
@@ -152,7 +152,7 @@ public class ResourceMonitorServiceImplTest {
         String queryTimestamp = "1577071879000";
 
         RequestBody body = null;
-        when(kpiSliceService.listPDUSessionEstSR(body)).thenReturn(failedCall("kpi is not exist!"));
+        when(kpiSliceClient.listPDUSessionEstSR(body)).thenReturn(failedCall("kpi is not exist!"));
         resourceMonitorService.querySlicingPDUSessionEstSR(queryTimestamp, serviceList);
     }
 }
index 1a6734c..1df0e7d 100644 (file)
@@ -45,7 +45,7 @@ import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.EndPo
 import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.Relationship;
 import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.RelationshipData;
 import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.RelationshipList;
-import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceService;
+import org.onap.usecaseui.server.service.slicingdomain.so.SOSliceClient;
 import org.onap.usecaseui.server.service.slicingdomain.so.bean.SOTask;
 import org.onap.usecaseui.server.service.slicingdomain.aai.AAISliceClient;
 import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.ConnectionLinkList;
@@ -53,15 +53,15 @@ import org.onap.usecaseui.server.service.slicingdomain.aai.bean.connection.Conne
 public class TaskMgtServiceImplTest {
 
     TaskMgtServiceImpl taskMgtService = null;
-    SOSliceService soSliceService = null;
+    SOSliceClient soSliceClient = null;
     AAISliceClient aaiSliceClient = null;
     TaskMgtServiceConvert taskMgtServiceConvert = null;
 
     @Before
     public void before() throws Exception {
-        soSliceService = mock(SOSliceService.class);
+        soSliceClient = mock(SOSliceClient.class);
         aaiSliceClient = mock(AAISliceClient.class);
-        taskMgtService = new TaskMgtServiceImpl(soSliceService,aaiSliceClient);
+        taskMgtService = new TaskMgtServiceImpl(soSliceClient,aaiSliceClient);
         taskMgtServiceConvert = mock(TaskMgtServiceConvert.class);
         taskMgtService.taskMgtServiceConvert = taskMgtServiceConvert;
     }
@@ -69,13 +69,13 @@ public class TaskMgtServiceImplTest {
     @Test
     public void itCanQuerySlicingTask() {
         JSONArray jsonArray = new JSONArray();
-        when(soSliceService.listTask()).thenReturn(successfulCall(jsonArray));
+        when(soSliceClient.listTask()).thenReturn(successfulCall(jsonArray));
         taskMgtService.querySlicingTask(1, 100);
     }
 
     @Test
     public void querySlicingTaskWithThrowsException() {
-        when(soSliceService.listTask()).thenReturn(failedCall("so is not exist!"));
+        when(soSliceClient.listTask()).thenReturn(failedCall("so is not exist!"));
         taskMgtService.querySlicingTask(1, 100);
     }
 
@@ -83,14 +83,14 @@ public class TaskMgtServiceImplTest {
     public void itCanQuerySlicingTaskByStatus() {
         JSONArray jsonArray = new JSONArray();
         String status = "Planning";
-        when(soSliceService.listTaskByStage(status)).thenReturn(successfulCall(jsonArray));
+        when(soSliceClient.listTaskByStage(status)).thenReturn(successfulCall(jsonArray));
         taskMgtService.querySlicingTaskByStatus(status, 1, 100);
     }
 
     @Test
     public void querySlicingTaskByStatusWithThrowsException() {
         String status = "Planning";
-        when(soSliceService.listTaskByStage(status)).thenReturn(failedCall("so is not exist!"));
+        when(soSliceClient.listTaskByStage(status)).thenReturn(failedCall("so is not exist!"));
         taskMgtService.querySlicingTaskByStatus(status, 1, 100);
     }
 
@@ -98,14 +98,14 @@ public class TaskMgtServiceImplTest {
     public void itCanQueryTaskAuditInfo() {
         String taskId = "we23-345r-45ty-5687";
         SOTask soTask = new SOTask();
-        when(soSliceService.getTaskById(taskId)).thenReturn(successfulCall(soTask));
+        when(soSliceClient.getTaskById(taskId)).thenReturn(successfulCall(soTask));
         taskMgtService.queryTaskAuditInfo(taskId);
     }
 
     @Test
     public void queryTaskAuditInfoWithThrowsException() {
         String taskId = "we23-345r-45ty-5687";
-        when(soSliceService.getTaskById(taskId)).thenReturn(failedCall("so is not exist!"));
+        when(soSliceClient.getTaskById(taskId)).thenReturn(failedCall("so is not exist!"));
         taskMgtService.queryTaskAuditInfo(taskId);
     }
 
@@ -141,8 +141,8 @@ public class TaskMgtServiceImplTest {
         soTask.setParams(params);
         String jsonstr = JSON.toJSONString(soTask);
         RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonstr);
-        when(soSliceService.getTaskById(taskId)).thenReturn(successfulCall(soTask));
-        when(soSliceService.updateService(taskId, requestBody)).thenReturn(successfulCall(responseBody));
+        when(soSliceClient.getTaskById(taskId)).thenReturn(successfulCall(soTask));
+        when(soSliceClient.updateService(taskId, requestBody)).thenReturn(successfulCall(responseBody));
 
         taskMgtService.updateTaskAuditInfo(slicingTaskAuditInfo);
     }
@@ -164,7 +164,7 @@ public class TaskMgtServiceImplTest {
             }
         };
 
-        when(soSliceService.updateService(taskId, requestBody)).thenReturn(failedCall("so is not exist!"));
+        when(soSliceClient.updateService(taskId, requestBody)).thenReturn(failedCall("so is not exist!"));
         taskMgtService.updateTaskAuditInfo(slicingTaskAuditInfo);
     }
 
@@ -172,14 +172,14 @@ public class TaskMgtServiceImplTest {
     public void itCanQueryTaskCreationInfo() {
         String taskId = "we23-345r-45ty-5687";
         SOTask soTask = new SOTask();
-        when(soSliceService.getTaskByIdD(taskId)).thenReturn(successfulCall(soTask));
+        when(soSliceClient.getTaskByIdD(taskId)).thenReturn(successfulCall(soTask));
         taskMgtService.queryTaskCreationInfo(taskId);
     }
 
     @Test
     public void queryTaskCreationInfoWithThrowsException() {
         String taskId = "we23-345r-45ty-5687";
-        when(soSliceService.getTaskByIdD(taskId)).thenReturn(failedCall("so is not exist!"));
+        when(soSliceClient.getTaskByIdD(taskId)).thenReturn(failedCall("so is not exist!"));
         taskMgtService.queryTaskCreationInfo(taskId);
     }
 
@@ -187,14 +187,14 @@ public class TaskMgtServiceImplTest {
     public void itCanQueryTaskCreationProgress() {
         String taskId = "we23-345r-45ty-5687";
         SOTask soTask = new SOTask();
-        when(soSliceService.getTaskByIdD(taskId)).thenReturn(successfulCall(soTask));
+        when(soSliceClient.getTaskByIdD(taskId)).thenReturn(successfulCall(soTask));
         taskMgtService.queryTaskCreationProgress(taskId);
     }
 
     @Test
     public void queryTaskCreationProgressWithThrowsException() {
         String taskId = "we23-345r-45ty-5687";
-        when(soSliceService.getTaskByIdD(taskId)).thenReturn(failedCall("so is not exist!"));
+        when(soSliceClient.getTaskByIdD(taskId)).thenReturn(failedCall("so is not exist!"));
         taskMgtService.queryTaskCreationProgress(taskId);
     }