aboutsummaryrefslogtreecommitdiffstats
path: root/asdc-controller/src/test/java/org
diff options
context:
space:
mode:
authorzm330 <zhangminyj@chinamobile.com>2020-03-02 00:41:19 +0800
committerzm330 <zhangminyj@chinamobile.com>2020-03-02 14:52:41 +0800
commit1e0bac83b2d1ee5c66a476f85ee2cbc0fd2ec2bb (patch)
tree84cd2bee176f25b85f954ec7c43d1475a9e663f1 /asdc-controller/src/test/java/org
parentab9eb6aba42457ed9adb21d7239c7729bb26bd15 (diff)
Add Query ServiceProxyCustomization
Issue-ID: SO-2368 Signed-off-by: zm330 <zhangminyj@chinamobile.com> Change-Id: I12fc81ea5f0fc3975b5913b56b48ecb4cb3ebff5
Diffstat (limited to 'asdc-controller/src/test/java/org')
-rw-r--r--asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java22
-rw-r--r--asdc-controller/src/test/java/org/onap/so/asdc/utils/ASDCLoggingVisitorImpl.java4
2 files changed, 9 insertions, 17 deletions
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
index c25c4c2828..b8a2d01b49 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
@@ -75,19 +75,8 @@ import org.onap.so.asdc.installer.ToscaResourceStructure;
import org.onap.so.asdc.installer.VfModuleStructure;
import org.onap.so.asdc.installer.VfResourceStructure;
import org.onap.so.asdc.installer.bpmn.WorkflowResource;
-import org.onap.so.db.catalog.beans.ConfigurationResource;
-import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization;
-import org.onap.so.db.catalog.beans.Service;
-import org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization;
-import org.onap.so.db.catalog.beans.ToscaCsar;
-import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization;
-import org.onap.so.db.catalog.data.repository.ConfigurationResourceCustomizationRepository;
-import org.onap.so.db.catalog.data.repository.InstanceGroupRepository;
-import org.onap.so.db.catalog.data.repository.ServiceRepository;
-import org.onap.so.db.catalog.data.repository.ToscaCsarRepository;
-import org.onap.so.db.catalog.data.repository.VFModuleRepository;
-import org.onap.so.db.catalog.data.repository.VnfResourceRepository;
-import org.onap.so.db.catalog.data.repository.VnfcInstanceGroupCustomizationRepository;
+import org.onap.so.db.catalog.beans.*;
+import org.onap.so.db.catalog.data.repository.*;
import org.onap.so.db.request.beans.WatchdogComponentDistributionStatus;
import org.onap.so.db.request.data.repository.WatchdogComponentDistributionStatusRepository;
import org.springframework.beans.factory.annotation.Autowired;
@@ -325,8 +314,6 @@ public class ToscaResourceInstallerTest extends BaseTest {
notificationData.setServiceUUID("serviceUUID1");
notificationData.setWorkloadContext("workloadContext1");
-
-
String serviceType = "test-type1";
String serviceRole = "test-role1";
String category = "Network L3+";
@@ -356,6 +343,7 @@ public class ToscaResourceInstallerTest extends BaseTest {
doReturn(resourceCustomizationUUID).when(metadata).getValue("vfModuleModelCustomizationUUID");
ServiceRepository serviceRepo = spy(ServiceRepository.class);
+ ServiceInfoRepository serviceInfoRepo = spy(ServiceInfoRepository.class);
VnfResourceRepository vnfRepo = spy(VnfResourceRepository.class);
doReturn(null).when(vnfRepo).findResourceByModelUUID(uuid);
@@ -366,6 +354,7 @@ public class ToscaResourceInstallerTest extends BaseTest {
WorkflowResource workflowResource = spy(WorkflowResource.class);
ReflectionTestUtils.setField(toscaInstaller, "serviceRepo", serviceRepo);
+ ReflectionTestUtils.setField(toscaInstaller, "serviceInfoRepository", serviceInfoRepo);
ReflectionTestUtils.setField(toscaInstaller, "vnfRepo", vnfRepo);
ReflectionTestUtils.setField(toscaInstaller, "vfModuleRepo", vfModuleRepo);
ReflectionTestUtils.setField(toscaInstaller, "instanceGroupRepo", instanceGroupRepo);
@@ -436,7 +425,10 @@ public class ToscaResourceInstallerTest extends BaseTest {
assertNotNull(service);
service.setModelVersion("1.0");
+ ServiceInfo serviceInfo = new ServiceInfo();
+ serviceInfo.setService(service);
doReturn(service).when(serviceRepo).save(service);
+ doReturn(serviceInfo).when(serviceInfoRepo).save(any(ServiceInfo.class));
WatchdogComponentDistributionStatusRepository watchdogCDStatusRepository =
spy(WatchdogComponentDistributionStatusRepository.class);
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/utils/ASDCLoggingVisitorImpl.java b/asdc-controller/src/test/java/org/onap/so/asdc/utils/ASDCLoggingVisitorImpl.java
index 53d163a5bc..02c0f2dbf7 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/utils/ASDCLoggingVisitorImpl.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/utils/ASDCLoggingVisitorImpl.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.