diff options
author | Niamh Core <niamh.core@est.tech> | 2021-10-05 08:35:06 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-10-05 08:35:06 +0000 |
commit | 9ee0feb24f8f75ce05cf9e34e4621cf2b226657e (patch) | |
tree | 29a5f24bad9c5251ede2355deaf138c1f8cad5f5 /src/main/java/org | |
parent | b95f49172c6909a6b0dddc31ac99dd22d5189de0 (diff) | |
parent | 4cbd60b974fa68cab8501e9f3e9edef134eac09b (diff) |
Merge "Fix issues with SOnar Qube coverage report"
Diffstat (limited to 'src/main/java/org')
9 files changed, 21 insertions, 19 deletions
diff --git a/src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java b/src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java index 72e81709..2c2536ff 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java @@ -20,6 +20,8 @@ package org.onap.cps.ncmp.dmi.rest.controller; +import static org.onap.cps.ncmp.dmi.model.DmiModuleReadRequestBody.OperationEnum.READ; + import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import java.util.List; @@ -30,12 +32,12 @@ import org.onap.cps.ncmp.dmi.model.CmHandles; import org.onap.cps.ncmp.dmi.model.DataAccessReadRequest; import org.onap.cps.ncmp.dmi.model.DataAccessWriteRequest; import org.onap.cps.ncmp.dmi.model.DmiModuleReadRequestBody; -import org.onap.cps.ncmp.dmi.model.ModuleReference; import org.onap.cps.ncmp.dmi.model.ModuleSet; import org.onap.cps.ncmp.dmi.model.YangResources; import org.onap.cps.ncmp.dmi.rest.api.DmiPluginApi; import org.onap.cps.ncmp.dmi.rest.api.DmiPluginInternalApi; import org.onap.cps.ncmp.dmi.service.DmiService; +import org.onap.cps.ncmp.dmi.service.model.ModuleReference; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -68,7 +70,7 @@ public class DmiRestController implements DmiPluginApi, DmiPluginInternalApi { public ResponseEntity<YangResources> retrieveModuleResources( final @Valid DmiModuleReadRequestBody dmiModuleReadRequestBody, final String cmHandle) { - if (dmiModuleReadRequestBody.getOperation().toString().equals("read")) { + if (READ.equals(dmiModuleReadRequestBody.getOperation())) { final var moduleReferenceList = convertRestObjectToJavaApiObject(dmiModuleReadRequestBody); final var response = dmiService.getModuleResources(cmHandle, moduleReferenceList); return new ResponseEntity<>(response, HttpStatus.OK); @@ -172,4 +174,4 @@ public class DmiRestController implements DmiPluginApi, DmiPluginInternalApi { .convertValue(dmiModuleSchemaReadRequestBody.getData().getModules(), new TypeReference<List<ModuleReference>>() {}); } -}
\ No newline at end of file +} diff --git a/src/main/java/org/onap/cps/ncmp/dmi/service/DmiService.java b/src/main/java/org/onap/cps/ncmp/dmi/service/DmiService.java index bd0dc600..753810a2 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/service/DmiService.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/service/DmiService.java @@ -24,9 +24,9 @@ import java.util.List; import java.util.Map; import javax.validation.constraints.NotNull; import org.onap.cps.ncmp.dmi.exception.DmiException; -import org.onap.cps.ncmp.dmi.model.ModuleReference; import org.onap.cps.ncmp.dmi.model.ModuleSet; import org.onap.cps.ncmp.dmi.model.YangResources; +import org.onap.cps.ncmp.dmi.service.model.ModuleReference; /** * Interface for handling Dmi plugin Data. @@ -108,4 +108,4 @@ public interface DmiService { */ String writeResourceDataPassthroughForCmHandle(String cmHandle, String resourceIdentifier, String dataType, String data); -}
\ No newline at end of file +} 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 182bdd84..844cc4de 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 @@ -37,16 +37,16 @@ import org.onap.cps.ncmp.dmi.exception.DmiException; import org.onap.cps.ncmp.dmi.exception.ModuleResourceNotFoundException; import org.onap.cps.ncmp.dmi.exception.ModulesNotFoundException; import org.onap.cps.ncmp.dmi.exception.ResourceDataNotFound; -import org.onap.cps.ncmp.dmi.model.CmHandleOperation; -import org.onap.cps.ncmp.dmi.model.CreatedCmHandle; -import org.onap.cps.ncmp.dmi.model.ModuleReference; -import org.onap.cps.ncmp.dmi.model.ModuleSchemaProperties; -import org.onap.cps.ncmp.dmi.model.ModuleSchemas; import org.onap.cps.ncmp.dmi.model.ModuleSet; import org.onap.cps.ncmp.dmi.model.ModuleSetSchemas; import org.onap.cps.ncmp.dmi.model.YangResource; import org.onap.cps.ncmp.dmi.model.YangResources; import org.onap.cps.ncmp.dmi.service.client.NcmpRestClient; +import org.onap.cps.ncmp.dmi.service.model.CmHandleOperation; +import org.onap.cps.ncmp.dmi.service.model.CreatedCmHandle; +import org.onap.cps.ncmp.dmi.service.model.ModuleReference; +import org.onap.cps.ncmp.dmi.service.model.ModuleSchemaProperties; +import org.onap.cps.ncmp.dmi.service.model.ModuleSchemas; import org.onap.cps.ncmp.dmi.service.operation.SdncOperations; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -269,4 +269,4 @@ public class DmiServiceImpl implements DmiService { return responseBodyAsJsonObject.getAsJsonObject(IETF_NETCONF_MONITORING_OUTPUT).getAsJsonPrimitive("data") .toString(); } -}
\ No newline at end of file +} diff --git a/src/main/java/org/onap/cps/ncmp/dmi/model/CmHandleOperation.java b/src/main/java/org/onap/cps/ncmp/dmi/service/model/CmHandleOperation.java index 8ddd42f8..82eac92a 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/model/CmHandleOperation.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/service/model/CmHandleOperation.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.cps.ncmp.dmi.model; +package org.onap.cps.ncmp.dmi.service.model; import com.fasterxml.jackson.annotation.JsonInclude; import java.util.List; @@ -32,4 +32,4 @@ public class CmHandleOperation { private String dmiPlugin; private List<CreatedCmHandle> createdCmHandles; -}
\ No newline at end of file +} diff --git a/src/main/java/org/onap/cps/ncmp/dmi/model/CreatedCmHandle.java b/src/main/java/org/onap/cps/ncmp/dmi/service/model/CreatedCmHandle.java index 9198d7da..6ab6a01e 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/model/CreatedCmHandle.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/service/model/CreatedCmHandle.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.cps.ncmp.dmi.model; +package org.onap.cps.ncmp.dmi.service.model; import com.fasterxml.jackson.annotation.JsonInclude; import java.util.Map; @@ -33,4 +33,4 @@ public class CreatedCmHandle { private String cmHandle; private Map<String, String> cmHandleProperties; -}
\ No newline at end of file +} diff --git a/src/main/java/org/onap/cps/ncmp/dmi/model/ModuleReference.java b/src/main/java/org/onap/cps/ncmp/dmi/service/model/ModuleReference.java index cb9b7cbb..75c37dff 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/model/ModuleReference.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/service/model/ModuleReference.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.cps.ncmp.dmi.model; +package org.onap.cps.ncmp.dmi.service.model; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/src/main/java/org/onap/cps/ncmp/dmi/model/ModuleSchemaList.java b/src/main/java/org/onap/cps/ncmp/dmi/service/model/ModuleSchemaList.java index 1e7dcb0a..a4af1761 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/model/ModuleSchemaList.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/service/model/ModuleSchemaList.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.cps.ncmp.dmi.model; +package org.onap.cps.ncmp.dmi.service.model; import java.util.List; import lombok.Getter; diff --git a/src/main/java/org/onap/cps/ncmp/dmi/model/ModuleSchemaProperties.java b/src/main/java/org/onap/cps/ncmp/dmi/service/model/ModuleSchemaProperties.java index 507758ad..6de7d131 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/model/ModuleSchemaProperties.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/service/model/ModuleSchemaProperties.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.cps.ncmp.dmi.model; +package org.onap.cps.ncmp.dmi.service.model; import java.util.List; import lombok.Getter; diff --git a/src/main/java/org/onap/cps/ncmp/dmi/model/ModuleSchemas.java b/src/main/java/org/onap/cps/ncmp/dmi/service/model/ModuleSchemas.java index 5945168b..a7b2430d 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/model/ModuleSchemas.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/service/model/ModuleSchemas.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.cps.ncmp.dmi.model; +package org.onap.cps.ncmp.dmi.service.model; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Getter; |