diff options
author | Rob Daugherty <rd472p@att.com> | 2018-05-02 16:46:14 -0400 |
---|---|---|
committer | Rob Daugherty <rd472p@att.com> | 2018-05-04 15:28:51 +0000 |
commit | 3ee4ec41ac18e51a16eafa767e090502b1a33fb5 (patch) | |
tree | 11a4d7b6c3bc5b88ce8dd67f12c7726c9f7dd80f /adapters/mso-vnf-adapter/src/main/java | |
parent | 13999df2b5cbcfd29d479e20970b39ba876725f3 (diff) |
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 <rd472p@att.com>
Diffstat (limited to 'adapters/mso-vnf-adapter/src/main/java')
-rw-r--r-- | adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfCloudifyAdapterImpl.java | 8 |
1 files changed, 3 insertions, 5 deletions
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> cloudSite = cloudConfig.getCloudSite (cloudSiteId); + Optional<CloudSite> 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); |