diff options
Diffstat (limited to 'asdc-controller/src/test/java')
-rw-r--r-- | asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java | 22 | ||||
-rw-r--r-- | asdc-controller/src/test/java/org/onap/so/asdc/utils/ASDCLoggingVisitorImpl.java | 4 |
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. |