summaryrefslogtreecommitdiffstats
path: root/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service
diff options
context:
space:
mode:
authorsourabh_sourabh <sourabh.sourabh@est.tech>2023-10-06 19:18:46 +0100
committersourabh_sourabh <sourabh.sourabh@est.tech>2023-10-10 15:03:19 +0100
commit6c338a5655f569adff88d9317e7482f1482b455d (patch)
tree957c42ab450b78bd4d1e1e55ad05d90738cc1407 /dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service
parent02ce57c4324b0e465daa9f20538417874f449ad6 (diff)
Conflicting Error code
-Used common error codes for NCMP responses Issue-ID: CPS-1904 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Id2beaa9f3d49dffd0a193b05fbaa7a6dd801e34a Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
Diffstat (limited to 'dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service')
-rw-r--r--dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java b/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java
index 987436febc..3f9731d72d 100644
--- a/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java
+++ b/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java
@@ -20,6 +20,8 @@
package org.onap.cps.ncmp.dmi.rest.stub.controller;
+import static org.onap.cps.ncmp.api.NcmpResponseStatus.SUCCESS;
+
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.cloudevents.CloudEvent;
@@ -28,12 +30,10 @@ import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
-import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
-import org.onap.cps.ncmp.api.NcmpEventResponseCode;
import org.onap.cps.ncmp.api.impl.utils.EventDateTimeFormatter;
import org.onap.cps.ncmp.dmi.rest.stub.model.data.operational.CmHandle;
import org.onap.cps.ncmp.dmi.rest.stub.model.data.operational.DataOperationRequest;
@@ -161,9 +161,9 @@ public class DmiRestStubController {
private DataOperationEvent getDataOperationEvent(final DataOperationRequest dataOperationRequest) {
final Response response = new Response();
response.setOperationId(dataOperationRequest.getOperationId());
- response.setStatusCode(NcmpEventResponseCode.SUCCESS.getStatusCode());
- response.setStatusMessage(NcmpEventResponseCode.SUCCESS.getStatusMessage());
- response.setIds(dataOperationRequest.getCmHandles().stream().map(CmHandle::getId).collect(Collectors.toList()));
+ response.setStatusCode(SUCCESS.getCode());
+ response.setStatusMessage(SUCCESS.getMessage());
+ response.setIds(dataOperationRequest.getCmHandles().stream().map(CmHandle::getId).toList());
response.setResourceIdentifier(dataOperationRequest.getResourceIdentifier());
response.setOptions(dataOperationRequest.getOptions());
final String ietfNetworkTopologySample = ResourceFileReaderUtil
@@ -176,7 +176,7 @@ public class DmiRestStubController {
} catch (final ParseException parseException) {
log.error("Unable to parse event result as json object. cause : {}", parseException.getMessage());
}
- final List<Response> responseList = new ArrayList<>();
+ final List<Response> responseList = new ArrayList<>(1);
responseList.add(response);
final Data data = new Data();
data.setResponses(responseList);