From 5906438d1cff0126e4289b57827adba6e8e76729 Mon Sep 17 00:00:00 2001 From: "Kalkere Ramesh, Sharan (sk720x)" Date: Fri, 7 Dec 2018 12:00:08 -0500 Subject: fix volume group model info retrieval fixed the broken unit test with updated mocks fix the if statement where its supposed to take in cloudRegion Change-Id: I0a1f349ff8d64dfec7ad98b351c8701f9cb828bb Issue-ID: SO-1297 Signed-off-by: Kalkere Ramesh, Sharan (sk720x) --- .../so/bpmn/servicedecomposition/tasks/BBInputSetup.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'bpmn/MSOCommonBPMN/src/main/java/org') 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 c0f1c48b76..b1e5d0d208 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 @@ -115,7 +115,7 @@ public class BBInputSetup implements JavaDelegate { private BBInputSetupMapperLayer mapperLayer; @Autowired - private CloudInfoFromAAI bbInputSetupHelper; + private CloudInfoFromAAI cloudInfoFromAAI; @Autowired private ExceptionBuilder exceptionUtil; @@ -125,6 +125,10 @@ public class BBInputSetup implements JavaDelegate { public BBInputSetupUtils getBbInputSetupUtils() { return bbInputSetupUtils; } + + public void setCloudInfoFromAAI(CloudInfoFromAAI cloudInfoFromAAI) { + this.cloudInfoFromAAI = cloudInfoFromAAI; + } public void setBbInputSetupUtils(BBInputSetupUtils bbInputSetupUtils) { this.bbInputSetupUtils = bbInputSetupUtils; @@ -987,7 +991,7 @@ public class BBInputSetup implements JavaDelegate { ServiceInstance serviceInstance = gBB.getServiceInstance(); CloudRegion cloudRegion = null; if(cloudConfiguration == null) { - Optional cloudRegionOp = bbInputSetupHelper.getCloudInfoFromAAI(serviceInstance); + Optional cloudRegionOp = cloudInfoFromAAI.getCloudInfoFromAAI(serviceInstance); if(cloudRegionOp.isPresent()) { cloudRegion = cloudRegionOp.get(); } @@ -1040,9 +1044,9 @@ public class BBInputSetup implements JavaDelegate { vnfModelInfo.setModelCustomizationUuid(vnfModelCustomizationUUID); this.mapCatalogVnf(vnf, vnfModelInfo, service); lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, vnf.getVnfId()); - if (cloudConfiguration != null) { - String volumeGroupCustomizationUUID = this.bbInputSetupUtils.getAAIVolumeGroup(cloudConfiguration.getCloudOwner(), - cloudConfiguration.getLcpCloudRegionId(), volumeGroup.getVolumeGroupId()) + if (cloudRegion != null) { + String volumeGroupCustomizationUUID = this.bbInputSetupUtils.getAAIVolumeGroup(cloudRegion.getCloudOwner(), + cloudRegion.getLcpCloudRegionId(), volumeGroup.getVolumeGroupId()) .getModelCustomizationId(); ModelInfo volumeGroupModelInfo = new ModelInfo(); volumeGroupModelInfo.setModelCustomizationId(volumeGroupCustomizationUUID); -- cgit 1.2.3-korg