aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters/src/test
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2019-02-14 19:54:00 -0500
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-02-14 19:55:59 -0500
commitf950d102e204be4f23b675997648c370ad2c0c3b (patch)
treebc2adc620f5c82625c7ec6605f45b313344cbf70 /adapters/mso-openstack-adapters/src/test
parent1d69925fef5c972f045081db9b5e4795d96c6f84 (diff)
fix issue where we attempt audit with no servers
fix issue where we attempt audit with no servers Change-Id: I47f76121c616bf65a5f8be73910adcc0d7088bdb Issue-ID: SO-1513 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'adapters/mso-openstack-adapters/src/test')
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/HeatStackAuditTest.java11
-rw-r--r--adapters/mso-openstack-adapters/src/test/resources/GetResourcesNoServer.json25
2 files changed, 36 insertions, 0 deletions
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/HeatStackAuditTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/HeatStackAuditTest.java
index b3cdd467bb..696784110b 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/HeatStackAuditTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/HeatStackAuditTest.java
@@ -196,6 +196,17 @@ public class HeatStackAuditTest extends HeatStackAudit {
JSONAssert.assertEquals(expectedValue, actualValue, false);
}
+ @Test
+ public void auditHeatStackNoServers_Test() throws Exception{
+
+
+ Resources getResource = objectMapper.readValue(new File("src/test/resources/Service1ResourceGroupResponse.json"), Resources.class);
+ doReturn(getResource).when(msoHeatUtilsMock).queryStackResources(cloudRegion, tenantId, "heatStackName");
+
+ boolean actual = heatStackAudit.auditHeatStack(cloudRegion, "cloudOwner", tenantId, "heatStackName");
+ assertEquals(true, actual);
+ }
+
@Test
public void findInterfaceInformation_Test(){
diff --git a/adapters/mso-openstack-adapters/src/test/resources/GetResourcesNoServer.json b/adapters/mso-openstack-adapters/src/test/resources/GetResourcesNoServer.json
new file mode 100644
index 0000000000..cfc9e5a0f1
--- /dev/null
+++ b/adapters/mso-openstack-adapters/src/test/resources/GetResourcesNoServer.json
@@ -0,0 +1,25 @@
+{
+ "resources": [
+ {
+ "resource_name": "OAMFW_SECURITY_GROUP",
+ "links": [
+ {
+ "href": "http://orchestration.com:443/v1/872f331350c54e59991a8de2cbffb40c/stacks/zauk51bfrwl03_base_NC_01/08c898a4-ba71-4365-9681-993d4129164a/resources/OAMFW_SECURITY_GROUP",
+ "rel": "self"
+ },
+ {
+ "href": "http://orchestration.com:443/v1/872f331350c54e59991a8de2cbffb40c/stacks/zauk51bfrwl03_base_NC_01/08c898a4-ba71-4365-9681-993d4129164a",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "OAMFW_SECURITY_GROUP",
+ "creation_time": "2019-02-13T21:17:03Z",
+ "resource_status": "CREATE_COMPLETE",
+ "updated_time": "2019-02-13T21:17:03Z",
+ "required_by": [],
+ "resource_status_reason": "state changed",
+ "physical_resource_id": "420833ff-2733-4043-868c-2f2d5bee8f93",
+ "resource_type": "OS::Neutron::SecurityGroup"
+ }
+ ]
+} \ No newline at end of file