aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-rest-stub/src/main
diff options
context:
space:
mode:
authorbmiklos <miklos.baranyak@est.tech>2022-09-05 18:25:46 +0200
committerbmiklos <miklos.baranyak@est.tech>2022-09-07 12:07:40 +0200
commit440dc8aab179f6c8451683f53b019ccd8bd60bdf (patch)
tree0b4568eb55924cb69c4d599e75cc658a6a126eb5 /cps-ncmp-rest-stub/src/main
parentbd22f203779e6c396f10d9064565d72f0488dad0 (diff)
Handle invalid operations on merged datastore endpoint
- Move the other endpoints under the same thats handling the get - Add exceptions to handle invalid cases - Add new tests for testing the invalid cases Issue-ID: CPS-1001 Issue-ID: CPS-1219 Change-Id: I26fd57b5921f976cde7089b4cf1e8c0e5d8dc43b Signed-off-by: bmiklos <miklos.baranyak@est.tech>
Diffstat (limited to 'cps-ncmp-rest-stub/src/main')
-rw-r--r--cps-ncmp-rest-stub/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/cps-ncmp-rest-stub/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java b/cps-ncmp-rest-stub/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java
index ac5337dbd3..bb919b5c6e 100644
--- a/cps-ncmp-rest-stub/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java
+++ b/cps-ncmp-rest-stub/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java
@@ -57,13 +57,13 @@ public class NetworkCmProxyStubController implements NetworkCmProxyApi {
private String pathToResponseFiles;
@Override
- public ResponseEntity<Object> getResourceDataForCmHandle(final String dataStoreType,
+ public ResponseEntity<Object> getResourceDataForCmHandle(final String dataStoreName,
final String cmHandle,
final String resourceIdentifier,
final String optionsParamInQuery,
final String topicParamInQuery,
final Boolean includeDescendants) {
- if (DatastoreType.PASSTHROUGH_OPERATIONAL == DatastoreType.fromDatastoreName(dataStoreType)) {
+ if (DatastoreType.PASSTHROUGH_OPERATIONAL == DatastoreType.fromDatastoreName(dataStoreName)) {
final ResponseEntity<Map<String, Object>> asyncResponse = populateAsyncResponse(topicParamInQuery);
final Map<String, Object> asyncResponseData = asyncResponse.getBody();
Object responseObject = null;
@@ -87,7 +87,8 @@ public class NetworkCmProxyStubController implements NetworkCmProxyApi {
}
@Override
- public ResponseEntity<Void> createResourceDataRunningForCmHandle(final String resourceIdentifier,
+ public ResponseEntity<Void> createResourceDataRunningForCmHandle(final String datastoreName,
+ final String resourceIdentifier,
final String cmHandleId,
final Object body,
final String contentType) {
@@ -95,7 +96,8 @@ public class NetworkCmProxyStubController implements NetworkCmProxyApi {
}
@Override
- public ResponseEntity<Void> deleteResourceDataRunningForCmHandle(final String cmHandleId,
+ public ResponseEntity<Void> deleteResourceDataRunningForCmHandle(final String datastoreName,
+ final String cmHandleId,
final String resourceIdentifier,
final String contentType) {
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
@@ -152,7 +154,8 @@ public class NetworkCmProxyStubController implements NetworkCmProxyApi {
}
@Override
- public ResponseEntity<Object> patchResourceDataRunningForCmHandle(final String resourceIdentifier,
+ public ResponseEntity<Object> patchResourceDataRunningForCmHandle(final String datastoreName,
+ final String resourceIdentifier,
final String cmHandleId,
final Object body,
final String contentType) {
@@ -165,7 +168,8 @@ public class NetworkCmProxyStubController implements NetworkCmProxyApi {
}
@Override
- public ResponseEntity<Object> updateResourceDataRunningForCmHandle(final String resourceIdentifier,
+ public ResponseEntity<Object> updateResourceDataRunningForCmHandle(final String datastoreName,
+ final String resourceIdentifier,
final String cmHandleId,
final Object body,
final String contentType) {