diff options
author | lukegleeson <luke.gleeson@est.tech> | 2021-08-18 16:02:38 +0100 |
---|---|---|
committer | lukegleeson <luke.gleeson@est.tech> | 2021-08-18 16:02:38 +0100 |
commit | 408ef6505319baf2e2e522d6bf6874d7c806573d (patch) | |
tree | e276974da7038b3753c91728e419668d43c2453b /src/main/java/org | |
parent | 577efb09a39282c608b53a3099b7edc95954f9c2 (diff) |
Fix Sonar Qube Violations
Issue-ID: CPS-475
Signed-off-by: lukegleeson <luke.gleeson@est.tech>
Change-Id: I04c857c3046c76eb3311ad916af2c4321ca47686
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/cps/ncmp/dmi/service/operation/SdncOperations.java | 6 |
2 files changed, 4 insertions, 8 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 94bd97d7..4c8e8ecb 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 @@ -73,7 +73,6 @@ public class DmiServiceImpl implements DmiService { this.ncmpRestClient = ncmpRestClient; this.objectMapper = objectMapper; this.sdncOperations = sdncOperations; - this.objectMapper = objectMapper; } @Override @@ -84,8 +83,7 @@ public class DmiServiceImpl implements DmiService { if (StringUtils.isEmpty(responseBody)) { throw new ModulesNotFoundException(cmHandle, "SDNC returned no modules for given cm-handle."); } - final ModuleSet moduleSet = createModuleSchema(responseBody); - return moduleSet; + return createModuleSchema(responseBody); } else { throw new DmiException("SDNC is not able to process request.", "response code : " + responseEntity.getStatusCode() + " message : " + responseEntity.getBody()); @@ -129,7 +127,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() != HttpStatus.CREATED)) { throw new CmHandleRegistrationException(responseEntity.getBody()); } } diff --git a/src/main/java/org/onap/cps/ncmp/dmi/service/operation/SdncOperations.java b/src/main/java/org/onap/cps/ncmp/dmi/service/operation/SdncOperations.java index 358da590..d017714f 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/service/operation/SdncOperations.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/service/operation/SdncOperations.java @@ -127,8 +127,7 @@ public class SdncOperations { @NotNull private String prepareGetSchemaUrl(final String nodeId) { - final var getSchemaUrl = addResource(addTopologyDataUrlwithNode(nodeId), GET_SCHEMA_URL); - return getSchemaUrl; + return addResource(addTopologyDataUrlwithNode(nodeId), GET_SCHEMA_URL); } private String prepareGetOperationSchemaUrl(final String nodeId) { @@ -141,8 +140,7 @@ public class SdncOperations { private String prepareResourceDataUrl(final String nodeId, final String resourceId, final List<String> queryList) { - final var resourceDataUrl = addQuery(addResource(addTopologyDataUrlwithNode(nodeId), resourceId), queryList); - return resourceDataUrl; + return addQuery(addResource(addTopologyDataUrlwithNode(nodeId), resourceId), queryList); } @NotNull |