From 3ee4ec41ac18e51a16eafa767e090502b1a33fb5 Mon Sep 17 00:00:00 2001 From: Rob Daugherty Date: Wed, 2 May 2018 16:46:14 -0400 Subject: Fix CloudConfig junits ...for some definition of the word "fix". There is still a lot that's less than ideal about how CloudConfig is handled, and with how the unit tests are written. Change-Id: Ic8c66c64d336f22c141687cf41a4828810bf1aec Issue-ID: SO-584 Signed-off-by: Rob Daugherty --- .../org/openecomp/mso/adapters/vnf/MsoVnfCloudifyAdapterImpl.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'adapters/mso-vnf-adapter') diff --git a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfCloudifyAdapterImpl.java b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfCloudifyAdapterImpl.java index 1cd2c165ec..43021d2bfb 100644 --- a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfCloudifyAdapterImpl.java +++ b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfCloudifyAdapterImpl.java @@ -33,7 +33,6 @@ import javax.xml.ws.Holder; import org.openecomp.mso.adapters.vnf.exceptions.VnfAlreadyExists; import org.openecomp.mso.adapters.vnf.exceptions.VnfException; -import org.openecomp.mso.cloud.CloudConfig; import org.openecomp.mso.cloud.CloudConfigFactory; import org.openecomp.mso.cloud.CloudSite; import org.openecomp.mso.cloudify.beans.DeploymentInfo; @@ -72,7 +71,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { CloudConfigFactory cloudConfigFactory = new CloudConfigFactory(); - protected CloudConfig cloudConfig = cloudConfigFactory.getCloudConfig(); MsoPropertiesFactory msoPropertiesFactory=new MsoPropertiesFactory(); @@ -310,7 +308,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { try { // KLUDGE - Cloudify requires Tenant Name for Openstack. We have the ID. // Go directly to Keystone until APIs could be updated to supply the name. - MsoKeystoneUtils keystone = new MsoKeystoneUtils(MSO_PROP_VNF_ADAPTER); + MsoKeystoneUtils keystone = new MsoKeystoneUtils(MSO_PROP_VNF_ADAPTER, cloudConfigFactory); MsoTenant msoTenant = keystone.queryTenant(tenantId, cloudSiteId); String tenantName = (msoTenant != null? msoTenant.getTenantName() : tenantId); @@ -655,7 +653,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { // Perform a version check against cloudSite // Obtain the cloud site information where we will create the VF Module - Optional cloudSite = cloudConfig.getCloudSite (cloudSiteId); + Optional cloudSite = cloudConfigFactory.getCloudConfig().getCloudSite(cloudSiteId); if (!cloudSite.isPresent()) { throw new VnfException (new MsoCloudSiteNotFound (cloudSiteId)); } @@ -1117,7 +1115,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { try { // KLUDGE - Cloudify requires Tenant Name for Openstack. We have the ID. // Go directly to Keystone until APIs could be updated to supply the name. - MsoKeystoneUtils keystone = new MsoKeystoneUtils(MSO_PROP_VNF_ADAPTER); + MsoKeystoneUtils keystone = new MsoKeystoneUtils(MSO_PROP_VNF_ADAPTER, cloudConfigFactory); MsoTenant msoTenant = keystone.queryTenant(tenantId, cloudSiteId); String tenantName = (msoTenant != null? msoTenant.getTenantName() : tenantId); -- cgit 1.2.3-korg