summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenu Kumari <renu.kumari@bell.ca>2021-08-19 17:15:58 +0000
committerGerrit Code Review <gerrit@onap.org>2021-08-19 17:15:58 +0000
commiteeb7a94bc24f4458f134d9902b7c4e27fe2f6e76 (patch)
treeab455cc409bc660348593f32da9445377aa98ecd
parent073b65d020feb1c3cafa993afc0507da4d40c870 (diff)
parent408ef6505319baf2e2e522d6bf6874d7c806573d (diff)
Merge "Fix Sonar Qube Violations"
-rw-r--r--src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java6
-rw-r--r--src/main/java/org/onap/cps/ncmp/dmi/service/operation/SdncOperations.java6
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