diff options
author | mpriyank <priyank.maheshwari@est.tech> | 2022-03-23 15:20:10 +0530 |
---|---|---|
committer | mpriyank <priyank.maheshwari@est.tech> | 2022-03-23 15:31:32 +0530 |
commit | 786eb8050017bfc4ebf5d8cddb7abca34a10e82b (patch) | |
tree | 7f46b45c946c4bea21d00bb41ae4bf3ce5dc4534 /src/main/java/org/onap | |
parent | 90c66a249003796e321a2a1eb7eff4ee4e9ccd5a (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>
Diffstat (limited to 'src/main/java/org/onap')
-rw-r--r-- | src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java | 2 |
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()); } } |