summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpriyank <priyank.maheshwari@est.tech>2022-03-23 15:20:10 +0530
committermpriyank <priyank.maheshwari@est.tech>2022-03-23 15:31:32 +0530
commit786eb8050017bfc4ebf5d8cddb7abca34a10e82b (patch)
tree7f46b45c946c4bea21d00bb41ae4bf3ce5dc4534
parent90c66a249003796e321a2a1eb7eff4ee4e9ccd5a (diff)
Exception scenario handling
- Updated logic to throw exception when response code is not 2XX, previously it was checking for 201 CREATED Issue-ID: CPS-955 Change-Id: I45cc53cf5b0e603755a75dbd089ead0eb87e5970 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
-rw-r--r--src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java b/src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java
index 4f126227..38b044db 100644
--- a/src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java
+++ b/src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java
@@ -134,7 +134,7 @@ public class DmiServiceImpl implements DmiService {
"Parsing error occurred while converting given cm-handles object list to JSON ");
}
final ResponseEntity<String> responseEntity = ncmpRestClient.registerCmHandlesWithNcmp(cmHandlesJson);
- if ((responseEntity.getStatusCode() != HttpStatus.CREATED)) {
+ if (!responseEntity.getStatusCode().is2xxSuccessful()) {
throw new CmHandleRegistrationException(responseEntity.getBody());
}
}