diff options
author | Rama-Huawei <rama.subba.reddy.s@huawei.com> | 2019-04-16 12:26:13 +0530 |
---|---|---|
committer | Rama-Huawei <rama.subba.reddy.s@huawei.com> | 2019-04-16 12:26:13 +0530 |
commit | 71432f8c9cdd5fb4b2eded82f271e90a1e603fca (patch) | |
tree | 93fba3aaffa2a43d356ab3dc8fb228e30f364b83 /holmes-actions/src/test | |
parent | 587fb47efbbee8ef3442323cec61cce046c67fbb (diff) |
Update AAI Assistant Tools for CCVPN Extenstion
Increased CCVPN extension code coverage to 100%
Issue-ID: HOLMES-194
Change-Id: Ib75bff68a08ddd0bee276aafa922d3cb3cb8c435
Signed-off-by: Rama-Huawei <rama.subba.reddy.s@huawei.com>
Diffstat (limited to 'holmes-actions/src/test')
-rw-r--r-- | holmes-actions/src/test/java/org/onap/holmes/common/aai/AaiQuery4Ccvpn2Test.java | 22 | ||||
-rw-r--r-- | holmes-actions/src/test/resources/ccvpn2.data.json | 6 |
2 files changed, 27 insertions, 1 deletions
diff --git a/holmes-actions/src/test/java/org/onap/holmes/common/aai/AaiQuery4Ccvpn2Test.java b/holmes-actions/src/test/java/org/onap/holmes/common/aai/AaiQuery4Ccvpn2Test.java index 1fca1da..cd1d505 100644 --- a/holmes-actions/src/test/java/org/onap/holmes/common/aai/AaiQuery4Ccvpn2Test.java +++ b/holmes-actions/src/test/java/org/onap/holmes/common/aai/AaiQuery4Ccvpn2Test.java @@ -140,6 +140,28 @@ public class AaiQuery4Ccvpn2Test { PowerMock.verifyAll(); } + @Test + public void test_getServiceInstancesNull_exception() throws CorrelationException { + mockGetMethod(); + EasyMock.expect(response.readEntity(String.class)).andReturn(data.getJSONObject("site-resources1").toJSONString + ()); + EasyMock.expect(response.getStatusInfo()).andReturn(Response.Status.OK); + + mockGetMethod(); + EasyMock.expect(response.readEntity(String.class)).andReturn(data.getJSONObject("499hkg9933NNN").toJSONString + ()); + EasyMock.expect(response.getStatusInfo()).andReturn(Response.Status.OK); + + mockGetMethod(); + EasyMock.expect(response.readEntity(String.class)).andReturn(data.getJSONObject("499hkg9933NNN").toJSONString + ()); + EasyMock.expect(response.getStatusInfo()).andReturn(Response.Status.OK); + + PowerMock.replayAll(); + + aai.getSiteServiceInstance("HkHubONSDEMOSZHKCustomer"); + } + private void mockGetMethod() { initCommonMock(); diff --git a/holmes-actions/src/test/resources/ccvpn2.data.json b/holmes-actions/src/test/resources/ccvpn2.data.json index 23faa60..7739893 100644 --- a/holmes-actions/src/test/resources/ccvpn2.data.json +++ b/holmes-actions/src/test/resources/ccvpn2.data.json @@ -49,6 +49,10 @@ } ] }, + "site-resources1": { + "site-resource": [ + ] + }, "499hkg9933NNN": { "site-resource-id": "3801b392-f596-4f7b-93d6-4d0a33b014bc", "site-resource-name": "HkHubONSDEMOBJHKCustomer", @@ -95,4 +99,4 @@ ] } } -}
\ No newline at end of file +} |