summaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2022-04-13 11:21:15 +0100
committerMichael Morris <michael.morris@est.tech>2022-04-21 09:48:05 +0000
commit30ff812c65389f5ca4c91d9774d425e81ef62049 (patch)
treeb7d293c23621df6c1084b9ff7dbde9c7d7d888ac /openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src
parent225dabdf0812d1a3d9eb3a96740507744bb2b807 (diff)
Check if VLM is used before deleting
Checks if the VLM is in use by any VSP before allowing to delete it. Add unit tests for the delete method, considering the restriction. Applies minor refactors with related code. Change-Id: I4ff6ddf3959a4ca92ab68b29c8913fc6f0ebdb3c Issue-ID: SDC-3966 Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json2
1 files changed, 2 insertions, 0 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json
index 5b2e808781..3d2a48107f 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json
@@ -19,6 +19,8 @@
"PACKAGE_NOT_FOUND": "NOT_FOUND",
"PACKAGE_INVALID": "BAD_REQUEST",
"VENDOR_LICENSE_MODEL_NOT_FOUND": "NOT_FOUND",
+ "VLM_IS_IN_USE_DELETE_ERROR": "FORBIDDEN",
+ "VLM_IS_CERTIFIED_DELETE_ERROR": "FORBIDDEN",
"VENDOR_LICENSE_ENTITY_NOT_FOUND": "NOT_FOUND",
"VERSIONABLE_SUB_ENTITY_NOT_FOUND": "NOT_FOUND",
"FEATURE_GROUP_NOT_EXIST_FOR_VSP": "NOT_FOUND",