diff options
Diffstat (limited to 'bpmn')
3 files changed, 32 insertions, 5 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java index 5296d5995f..7edf39df14 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java @@ -609,8 +609,9 @@ public class BBInputSetup implements JavaDelegate { .getVnfcInstanceGroupCustomizations(); for (VnfcInstanceGroupCustomization vnfcInstanceGroupCust : vnfcInstanceGroups) { InstanceGroup instanceGroup = this.createInstanceGroup(); - instanceGroup.setModelInfoInstanceGroup(this.mapperLayer - .mapCatalogInstanceGroupToInstanceGroup(null, vnfcInstanceGroupCust.getInstanceGroup())); + org.onap.so.db.catalog.beans.InstanceGroup catalogInstanceGroup = bbInputSetupUtils.getCatalogInstanceGroup(vnfcInstanceGroupCust.getModelUUID()); + instanceGroup.setModelInfoInstanceGroup(this.mapperLayer + .mapCatalogInstanceGroupToInstanceGroup(null, catalogInstanceGroup)); instanceGroup.getModelInfoInstanceGroup().setFunction(vnfcInstanceGroupCust.getFunction()); instanceGroup.setDescription(vnfcInstanceGroupCust.getDescription()); genericVnf.getInstanceGroups().add(instanceGroup); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java index e32362d1b0..b36d6d43f8 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java @@ -99,6 +99,7 @@ import org.onap.so.db.catalog.beans.OrchestrationStatus; import org.onap.so.db.catalog.beans.Service; import org.onap.so.db.catalog.beans.VfModuleCustomization; import org.onap.so.db.catalog.beans.VnfResourceCustomization; +import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization; import org.onap.so.db.request.beans.InfraActiveRequests; import org.onap.so.serviceinstancebeans.CloudConfiguration; import org.onap.so.serviceinstancebeans.ModelInfo; @@ -1203,6 +1204,31 @@ public class BBInputSetupTest { } @Test + public void testMapVnfcCollectionInstanceGroup() { + VnfResourceCustomization vnfResourceCust = Mockito.mock(VnfResourceCustomization.class); + GenericVnf genericVnf = new GenericVnf(); + ModelInfo modelInfo = Mockito.mock(ModelInfo.class); + Service service = Mockito.mock(Service.class); + List<VnfcInstanceGroupCustomization> vnfcInstanceGroups = new ArrayList<>(); + VnfcInstanceGroupCustomization vnfcInstanceGroupCust = new VnfcInstanceGroupCustomization(); + vnfcInstanceGroupCust.setModelUUID("modelUUID"); + vnfcInstanceGroupCust.setFunction("function"); + vnfcInstanceGroupCust.setDescription("description"); + vnfcInstanceGroups.add(vnfcInstanceGroupCust); + org.onap.so.db.catalog.beans.InstanceGroup instanceGroup = new org.onap.so.db.catalog.beans.InstanceGroup(); + instanceGroup.setModelUUID("modelUUID"); + ModelInfoInstanceGroup modelInfoInstanceGroup = new ModelInfoInstanceGroup(); + modelInfoInstanceGroup.setModelUUID("modelUUID"); + doReturn(vnfResourceCust).when(SPY_bbInputSetup).getVnfResourceCustomizationFromService(modelInfo, service); + doReturn(vnfcInstanceGroups).when(vnfResourceCust).getVnfcInstanceGroupCustomizations(); + doReturn(instanceGroup).when(SPY_bbInputSetupUtils).getCatalogInstanceGroup("modelUUID"); + doReturn(modelInfoInstanceGroup).when(bbInputSetupMapperLayer).mapCatalogInstanceGroupToInstanceGroup(null, instanceGroup); + + SPY_bbInputSetup.mapVnfcCollectionInstanceGroup(genericVnf, modelInfo, service); + + assertEquals("Instance Group was created", true, genericVnf.getInstanceGroups().size() == 1); + } + @Test public void testPopulateGenericVnfWhereVnfTypeIsNull() throws JsonParseException, JsonMappingException, IOException { org.onap.so.serviceinstancebeans.Platform platform = new org.onap.so.serviceinstancebeans.Platform(); diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn index 17f6c66e4a..6084f570ce 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn @@ -189,7 +189,7 @@ dcsi.postDecomposeService(execution)]]></bpmn:script> <camunda:inputParameter name="headers"> <camunda:map> <camunda:entry key="content-type">application/soap+xml</camunda:entry> - <camunda:entry key="Authorization">Basic QlBFTENsaWVudDpwYXNzd29yZDEk</camunda:entry> + <camunda:entry key="Authorization">${UrnPropertiesReader.getVariable("mso.adapters.requestDb.auth", execution)}</camunda:entry> </camunda:map> </camunda:inputParameter> <camunda:inputParameter name="payload">${CVFMI_updateServiceOperStatusRequest}</camunda:inputParameter> @@ -206,12 +206,12 @@ dcsi.postDecomposeService(execution)]]></bpmn:script> <bpmn:scriptTask id="ScriptTask_0f3tjbn" name="prepare update service operation status" scriptFormat="groovy"> <bpmn:incoming>SequenceFlow_0h5c1bd</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1ab3vex</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* execution.setVariable("progress", "100") execution.setVariable("result", "finished") execution.setVariable("operationContent", "No actual resoure in service instance") def csi= new DoDeleteE2EServiceInstance() -csi.prepareUpdateServiceOperationStatus(execution)]]></bpmn:script> +csi.prepareUpdateServiceOperationStatus(execution)</bpmn:script> </bpmn:scriptTask> <bpmn:intermediateCatchEvent id="IntermediateCatchEvent_0hrkmxb" name="End Delete Process"> <bpmn:outgoing>SequenceFlow_0h5c1bd</bpmn:outgoing> |