diff options
Diffstat (limited to 'holmes-actions/src')
-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 +} |