summaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters/src
diff options
context:
space:
mode:
authorMerkel, Jeff <jeff.merkel@att.com>2019-11-04 08:18:32 -0500
committerBenjamin, Max (mb388a) <mb388a@att.com>2019-11-04 08:18:32 -0500
commitf56de32112c5769c0174623a5cc9ab829cdc94a8 (patch)
treeb01f65b9dffa18e222536243c812b2beee2b1d20 /adapters/mso-openstack-adapters/src
parent47cb6260f222c2f0cb0c95a53646e3196a930a8b (diff)
- Check if failIfExists exists, if not default it.
- Check if failIfExists exists, if not default it. Issue-ID: SO-2507 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: I0ab965bca0fd6777d711c99d3bc550293e826414
Diffstat (limited to 'adapters/mso-openstack-adapters/src')
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java3
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterImplTest.java14
2 files changed, 17 insertions, 0 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
index 2769f1c9b8..9adcdcb47a 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
@@ -1074,6 +1074,9 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
if (backout == null) {
backout = true;
}
+ if (failIfExists == null) {
+ failIfExists = false;
+ }
if (msoHeatUtils != null) {
heatStack = msoHeatUtils.createStack(cloudSiteId, cloudOwner, tenantId, vfModuleName, null,
template, goldenInputs, true, heatTemplate.getTimeoutMinutes(), newEnvironmentString,
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterImplTest.java
index 0d972bb4d2..f3cad76c9d 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterImplTest.java
@@ -85,6 +85,20 @@ public class MsoVnfAdapterImplTest extends BaseRestTestUtils {
}
@Test
+ public void createVnfTest_NullFailIfExists() throws Exception {
+ mockOpenStackResponseAccess(wireMockServer, wireMockPort);
+ mockOpenStackGetStackVfModule_200(wireMockServer);
+
+ MsoRequest msoRequest = getMsoRequest();
+
+ Map<String, Object> map = new HashMap<>();
+ map.put("key1", "value1");
+ instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "",
+ "VFMOD", null, null, "b4ea86b4-253f-11e7-93ae-92361f002671", map, null, Boolean.TRUE, Boolean.FALSE,
+ msoRequest, new Holder<>(), new Holder<Map<String, String>>(), new Holder<VnfRollback>());
+ }
+
+ @Test
public void createVnfTest_HeatStatusFailed() throws Exception {
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
wireMockServer.stubFor(get(