From b0b12b71503f017e814c6aef6a0ab85f267e250c Mon Sep 17 00:00:00 2001 From: "Kalkere Ramesh, Sharan (sk720x)" Date: Fri, 7 Dec 2018 12:05:06 -0500 Subject: add in volume group model info lookup added in the lookup of volume group for vf on macro as well Change-Id: Ie3582724b78e88a0b2dd90c37dff086b5e2c3bf9 Issue-ID: SO-1298 Signed-off-by: Kalkere Ramesh, Sharan (sk720x) --- .../tasks/BBInputSetupTest.java | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'bpmn/MSOCommonBPMN/src/test/java/org/onap') 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 8399fe15a3..593154804d 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 @@ -40,6 +40,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.junit.Before; @@ -139,6 +140,30 @@ public class BBInputSetupTest { SPY_bbInputSetup.setMapperLayer(bbInputSetupMapperLayer); } + @Test + public void testGetVolumeGroupIdRelatedToVfModule() { + String expected = "volumeGroupId"; + String modelCustomizationId = "modelCustomizationId"; + ModelInfo modelInfo = new ModelInfo(); + modelInfo.setModelCustomizationId(modelCustomizationId); + String cloudOwner = "cloudOwner"; + String cloudRegionId = "cloudRegionId"; + String volumeGroupId = "volumeGroupId"; + GenericVnf vnf = new GenericVnf(); + VolumeGroup volumeGroup = new VolumeGroup(); + volumeGroup.setVolumeGroupId(expected); + vnf.getVolumeGroups().add(volumeGroup); + Map lookupKeyMap = new HashMap<>(); + lookupKeyMap.put(ResourceKey.VOLUME_GROUP_ID, null); + org.onap.aai.domain.yang.VolumeGroup aaiVolumeGroup = new org.onap.aai.domain.yang.VolumeGroup(); + aaiVolumeGroup.setModelCustomizationId(modelCustomizationId); + doReturn(aaiVolumeGroup).when(SPY_bbInputSetupUtils).getAAIVolumeGroup(cloudOwner, cloudRegionId, volumeGroupId); + + Optional actual = SPY_bbInputSetup.getVolumeGroupIdRelatedToVfModule(vnf, modelInfo, cloudOwner, cloudRegionId, lookupKeyMap); + + assertEquals(expected, actual.get()); + } + @Test public void testGetAlaCarteServiceInstance() throws Exception { ServiceInstance expected = mapper.readValue( -- cgit 1.2.3-korg