summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorniamhcore <niamh.core@est.tech>2021-09-15 13:01:25 +0100
committerniamhcore <niamh.core@est.tech>2021-09-15 16:20:02 +0100
commitaccefb1c6f1fbb2ab904acbf7d5f4eb33ef51cee (patch)
treed5a4af9c248f110d433366f58cea0a3eefc8c7ed /src/main
parent0f6e827fca9dea842515f47748822844fc5568e5 (diff)
Update response code for passthrough-running create use-case
Issue-ID: CPS-659 Signed-off-by: niamhcore <niamh.core@est.tech> Change-Id: I4ebc4f68604efe78efb951989c2fb021443c36c9
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java4
-rw-r--r--src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java2
2 files changed, 3 insertions, 3 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 4a18b067..37381fb1 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
@@ -84,14 +84,14 @@ public class DmiRestController implements DmiPluginApi, DmiPluginInternalApi {
* @return (@ code ResponseEntity) response entity
*/
@Override
- public ResponseEntity<Object> writeDataByPassthroughRunningForCmHandle(
+ public ResponseEntity<String> writeDataByPassthroughRunningForCmHandle(
final DataAccessWriteRequest dataAccessWriteRequest,
final String cmHandle, final String resourceIdentifier) {
final String response = dmiService.writeResourceDataPassthroughForCmHandle(cmHandle,
resourceIdentifier,
MediaType.APPLICATION_JSON_VALUE,
dataAccessWriteRequest.getData());
- return new ResponseEntity<>(response, HttpStatus.OK);
+ return new ResponseEntity<>(response, HttpStatus.CREATED);
}
/**
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 2512ce2f..db115ce4 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
@@ -223,7 +223,7 @@ public class DmiServiceImpl implements DmiService {
}
final ResponseEntity<String> responseEntity =
sdncOperations.writeResourceDataPassthroughRunning(cmHandle, resourceIdentifier, dataType, jsonData);
- if (responseEntity.getStatusCode() == HttpStatus.CREATED) {
+ if (responseEntity.getStatusCode().is2xxSuccessful()) {
return responseEntity.getBody();
} else {
throw new DmiException(cmHandle,