From 30ff812c65389f5ca4c91d9774d425e81ef62049 Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Wed, 13 Apr 2022 11:21:15 +0100 Subject: 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 --- .../src/main/resources/errorCodesToResponseStatusMapping.json | 2 ++ 1 file changed, 2 insertions(+) (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src') 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", -- cgit 1.2.3-korg