diff options
author | malar <malarvizhi.44@wipro.com> | 2022-11-09 11:21:02 +0000 |
---|---|---|
committer | Vijay Venkatesh Kumar <vv770d@att.com> | 2022-11-28 14:40:43 +0000 |
commit | d9f2a362ba952bb28e8356b341a176a3a1d696f9 (patch) | |
tree | 9394910bb0e43a23e2cd82a80806a3c468d1b429 /src/test/java/org | |
parent | 8445ea3ebf3d9cafdd280ee5eed225069d9b2c1b (diff) |
Modify ANR Payload aligned to A1 schema in SDNRkohn
Issue-ID: DCAEGEN2-3311
Signed-off-by: Malarvizhi Paramasivam <malarvizhi.44@wipro.com>
Change-Id: I809f59972b207b1a9e68f0a2339514b6c7761bb7
(cherry picked from commit 4949855dff35b340038bffc489b1e68f340cf5ce)
Diffstat (limited to 'src/test/java/org')
-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()); } |