From 98fbceb29d109cbc54c6f5f178727eefeb2fdd7e Mon Sep 17 00:00:00 2001 From: malar Date: Fri, 6 May 2022 12:46:52 +0000 Subject: Fix bug in handling FM notification Issue-ID: DCAEGEN2-3150 Signed-off-by: Malarvizhi Paramasivam Change-Id: I89f346ba5d369e7070e3181784513ffc4487360c --- Changelog.md | 2 ++ pom.xml | 2 +- .../dcaegen2/services/sonhms/restclient/CpsClient.java | 14 +++++++++----- .../dcaegen2/services/sonhms/restclient/CpsClientTest.java | 14 ++++++++------ version.properties | 2 +- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Changelog.md b/Changelog.md index 6a3731b..9ff9d6b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [2.1.7] - 2021/05/11 + - [DCAEGEN2-3150](https://jira.onap.org/browse/DCAEGEN2-3150) - Fix bug in handling FM notification ## [2.1.6] - 2022/02/07 - [DCAEGEN2-3057](https://jira.onap.org/browse/DCAEGEN2-3057) - Fix bug in triggering control loop for PCI collision/confusion - by replacing Config DB with CPS diff --git a/pom.xml b/pom.xml index 205692c..5365a15 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ org.onap.dcaegen2.services.son-handler son-handler dcaegen2-services-son-handler - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClient.java b/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClient.java index 282fe91..461d901 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClient.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/CpsClient.java @@ -90,6 +90,7 @@ public class CpsClient extends ConfigInterface { public int getPci(String cellId) throws CpsNotFoundException { Configuration configuration = Configuration.getInstance(); + int responseObject = 0; String requestUrl = configuration.getCpsServiceUrl() + "/" + configuration.getGetPciUrl(); JSONObject inputparam = new JSONObject(); JSONObject reqbody = new JSONObject(); @@ -97,10 +98,13 @@ public class CpsClient extends ConfigInterface { reqbody.put("inputParameters", inputparam); String response = sendRequest(requestUrl, reqbody); log.info("Response from CPS is : " + response); - JSONObject respObj = new JSONObject(response); - int obj = respObj.getInt("nRPCI"); - log.info("The nRPCI value is " + obj ); - return respObj.getInt("nRPCI"); + JSONArray requestArray = new JSONArray(response); + for (int i=0;i>any())) .thenReturn(ResponseEntity.ok(responseBody)); try { - String result = cps.getPnfName("cucpserver1"); + String result = cps.getPnfName("110"); String response = ResponseEntity.ok(responseBody).getBody(); JSONArray requestArray = new JSONArray(response); for (int i=0;i