diff options
Diffstat (limited to 'bpmn')
5 files changed, 30 insertions, 26 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BuildingBlockTestDataSetup.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BuildingBlockTestDataSetup.java index 9e10058ec8..e9d8a5dee9 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BuildingBlockTestDataSetup.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BuildingBlockTestDataSetup.java @@ -516,6 +516,11 @@ public class BuildingBlockTestDataSetup { modelInfoVfModule.setModelUUID("testModelUUID" + vfModuleCounter); modelInfoVfModule.setModelName("testModelName" + vfModuleCounter); modelInfoVfModule.setModelCustomizationUUID("testModelCustomizationUUID" + vfModuleCounter); + if (vfModuleCounter == 1) { + modelInfoVfModule.setIsBaseBoolean(Boolean.TRUE); + } else { + modelInfoVfModule.setIsBaseBoolean(Boolean.FALSE); + } vfModule.setModelInfoVfModule(modelInfoVfModule); return vfModule; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index fffaee0f7c..0553afb318 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -811,7 +811,9 @@ public class WorkflowAction { for (VfModule vfModule : vnf.getVfModules()) { aaiResourceIds.add( new Pair<WorkflowType, String>(WorkflowType.VFMODULE, vfModule.getVfModuleId())); - resourceCounter.add(new Resource(WorkflowType.VFMODULE, vfModule.getVfModuleId(), false)); + Resource resource = new Resource(WorkflowType.VFMODULE, vfModule.getVfModuleId(), false); + resource.setBaseVfModule(vfModule.getModelInfoVfModule().getIsBaseBoolean()); + resourceCounter.add(resource); } } if (vnf.getVolumeGroups() != null) { diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java index ff6426d351..825c703b74 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java @@ -542,6 +542,11 @@ public class TestDataSetup { modelInfoVfModule.setModelUUID("testModelUUID" + vfModuleCounter); modelInfoVfModule.setModelName("testModelName" + vfModuleCounter); modelInfoVfModule.setModelCustomizationUUID("testModelCustomizationUUID" + vfModuleCounter); + if (vfModuleCounter == 1) { + modelInfoVfModule.setIsBaseBoolean(Boolean.TRUE); + } else { + modelInfoVfModule.setIsBaseBoolean(Boolean.FALSE); + } vfModule.setModelInfoVfModule(modelInfoVfModule); return vfModule; diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java index 09ba55aac0..176a09a04b 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java @@ -29,6 +29,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.anyObject; import static org.mockito.ArgumentMatchers.anyString; @@ -73,6 +74,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration; import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds; +import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule; import org.onap.so.client.aai.AAIObjectType; import org.onap.so.client.aai.entities.AAIResultWrapper; import org.onap.so.client.aai.entities.Relationships; @@ -347,13 +349,10 @@ public class WorkflowActionTest extends BaseTaskTest { new org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf(); vnf.setVnfId("vnf0"); - org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule = - new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule(); - vfModule.setVfModuleId("vfModule0"); + + org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule = buildVfModule(); vnf.getVfModules().add(vfModule); - org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule2 = - new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule(); - vfModule2.setVfModuleId("vfModule1"); + org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule2 = buildVfModule(); vnf.getVfModules().add(vfModule2); org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup volumeGroup = @@ -374,10 +373,10 @@ public class WorkflowActionTest extends BaseTaskTest { "ActivateServiceInstanceBB"); assertEquals("volumeGroup0", ebbs.get(0).getWorkflowResourceIds().getVolumeGroupId()); assertEquals("volumeGroup0", ebbs.get(1).getWorkflowResourceIds().getVolumeGroupId()); - assertEquals("vfModule0", ebbs.get(2).getWorkflowResourceIds().getVfModuleId()); - assertEquals("vfModule1", ebbs.get(3).getWorkflowResourceIds().getVfModuleId()); - assertEquals("vfModule0", ebbs.get(4).getWorkflowResourceIds().getVfModuleId()); - assertEquals("vfModule1", ebbs.get(5).getWorkflowResourceIds().getVfModuleId()); + assertEquals("testVfModuleId1", ebbs.get(2).getWorkflowResourceIds().getVfModuleId()); + assertEquals("testVfModuleId2", ebbs.get(3).getWorkflowResourceIds().getVfModuleId()); + assertEquals("testVfModuleId1", ebbs.get(4).getWorkflowResourceIds().getVfModuleId()); + assertEquals("testVfModuleId2", ebbs.get(5).getWorkflowResourceIds().getVfModuleId()); assertEquals("vnf0", ebbs.get(6).getWorkflowResourceIds().getVnfId()); assertEquals("si0", ebbs.get(7).getWorkflowResourceIds().getServiceInstanceId()); @@ -682,13 +681,9 @@ public class WorkflowActionTest extends BaseTaskTest { new org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf(); vnf.setVnfId("vnfId123"); - org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule = - new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule(); - vfModule.setVfModuleId("vfModule1"); + org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule = buildVfModule(); vnf.getVfModules().add(vfModule); - org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule2 = - new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule(); - vfModule2.setVfModuleId("vfModule2"); + org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule2 = buildVfModule(); vnf.getVfModules().add(vfModule2); org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup volumeGroup = @@ -737,13 +732,9 @@ public class WorkflowActionTest extends BaseTaskTest { new org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf(); vnf.setVnfId("vnfId123"); - org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule = - new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule(); - vfModule.setVfModuleId("vfModule1"); + org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule = buildVfModule(); vnf.getVfModules().add(vfModule); - org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule2 = - new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule(); - vfModule2.setVfModuleId("vfModule2"); + org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule2 = buildVfModule(); vnf.getVfModules().add(vfModule2); org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup volumeGroup = @@ -1063,7 +1054,7 @@ public class WorkflowActionTest extends BaseTaskTest { vnfVfmoduleCvnfcConfigurationCustomization.setConfigurationResource(configurationResource); vnfVfmoduleCvnfcConfigurationCustomization.setModelInstanceName("modelInstanceName1"); vnfVfmoduleCvnfcConfigurationCustomization.setCvnfcCustomization(cvnfcCustomization); - Set<CvnfcConfigurationCustomization> custSet = new HashSet<CvnfcConfigurationCustomization>(); + List<CvnfcConfigurationCustomization> custSet = new ArrayList<CvnfcConfigurationCustomization>(); custSet.add(vnfVfmoduleCvnfcConfigurationCustomization); cvnfcCustomization.setCvnfcConfigurationCustomization(custSet); cvnfcCustomization.setDescription("description"); @@ -1077,7 +1068,7 @@ public class WorkflowActionTest extends BaseTaskTest { vnfVfmoduleCvnfcConfigurationCustomization2.setConfigurationResource(configurationResource2); vnfVfmoduleCvnfcConfigurationCustomization2.setModelInstanceName("modelInstanceName2"); vnfVfmoduleCvnfcConfigurationCustomization2.setCvnfcCustomization(cvnfcCustomization2); - Set<CvnfcConfigurationCustomization> custSet2 = new HashSet<CvnfcConfigurationCustomization>(); + List<CvnfcConfigurationCustomization> custSet2 = new ArrayList<CvnfcConfigurationCustomization>(); custSet2.add(vnfVfmoduleCvnfcConfigurationCustomization2); cvnfcCustomization2.setCvnfcConfigurationCustomization(custSet2); cvnfcCustomization2.setDescription("description2"); @@ -1726,6 +1717,7 @@ public class WorkflowActionTest extends BaseTaskTest { .getConfiguration("testConfigurationId2"); workflowAction.traverseAAIService(execution, resourceCounter, resourceId, aaiResourceIds); assertEquals(8, resourceCounter.size()); + assertTrue(resourceCounter.get(2).isBaseVfModule()); assertThat(aaiResourceIds, sameBeanAs(getExpectedResourceIds())); } catch (Exception e) { fail("Unexpected exception was thrown."); diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java index 34ad1b0fd4..6b5395ae07 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java @@ -89,7 +89,7 @@ public class WorkflowActionUnitTest { configuration.setToscaNodeType("FabricConfiguration"); configuration.setModelUUID("my-uuid"); vfModuleCustomization.setConfigurationResource(configuration); - cvnfcCustomization.setCvnfcConfigurationCustomization(Collections.singleton(vfModuleCustomization)); + cvnfcCustomization.setCvnfcConfigurationCustomization(Collections.singletonList(vfModuleCustomization)); List<CvnfcCustomization> cvnfcCustomizations = Arrays.asList(cvnfcCustomization); // when(catalogDbClient.getCvnfcCustomizationByVnfCustomizationUUIDAndVfModuleCustomizationUUID(any(String.class), // any(String.class))) |