diff options
author | malar <malarvizhi.44@wipro.com> | 2022-11-09 11:21:02 +0000 |
---|---|---|
committer | malar <malarvizhi.44@wipro.com> | 2022-11-22 06:22:25 +0000 |
commit | 4949855dff35b340038bffc489b1e68f340cf5ce (patch) | |
tree | 566a3f7e0bf019f25c6c24c04a9e1ebdccb5975a /src/test/java | |
parent | 55659eb8915a9107a55fc4ef56399734340a7a1a (diff) |
Modify ANR Payload aligned to A1 schema in SDNR2.1.11-son-handler
Issue-ID: DCAEGEN2-3311
Signed-off-by: Malarvizhi Paramasivam <malarvizhi.44@wipro.com>
Change-Id: I809f59972b207b1a9e68f0a2339514b6c7761bb7
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClientTest.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/test/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClientTest.java b/src/test/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClientTest.java index 4d8713a..6b6c94d 100644 --- a/src/test/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClientTest.java +++ b/src/test/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClientTest.java @@ -153,7 +153,7 @@ public class CpsClientTest { @Test public void getRicIdTest() { - String responseBody = "{\"idNearRTRIC\":\"22\"}"; + String responseBody = "[{\"idNearRTRIC\":\"22\"}]"; PowerMockito.mockStatic(SonHandlerRestTemplate.class); PowerMockito.mockStatic(Configuration.class); PowerMockito.when(Configuration.getInstance()).thenReturn(configuration); @@ -164,8 +164,10 @@ public class CpsClientTest { try { String result = cps.getRicId("1"); String response = ResponseEntity.ok(responseBody).getBody(); - JSONObject respObj = new JSONObject(response); - assertEquals(respObj.get("idNearRTRIC"), result); + JSONArray requestArray = new JSONArray(response); + for (int i=0;i<requestArray.length();i++) { + assertEquals(requestArray.getJSONObject(i).getString("idNearRTRIC"), result); + } } catch (CpsNotFoundException e) { log.debug("CpsNotFoundException {}", e.toString()); } |