diff options
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.java | 11 | ||||
-rw-r--r-- | adapters/mso-openstack-adapters/src/test/resources/GetResourcesNoServer.json | 25 |
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 |