From 3608fa7d186a3acffda0f3040abaad068a081410 Mon Sep 17 00:00:00 2001 From: KrupaNagabhushan Date: Thu, 2 Sep 2021 13:15:51 +0100 Subject: Error re-importing VSP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue-ID: SDC-3728 Signed-off-by: KrupaNagabhushan Signed-off-by: André Schmid Change-Id: I22d6186b8e6922511a7ede584d009cfae041fabd --- .../files/default/error-configuration.yaml | 16 ++++++++++++++++ .../be/components/lifecycle/UndoCheckoutTransition.java | 2 +- .../openecomp/sdc/be/servlets/ArchiveEndpointTest.java | 6 ++++++ 3 files changed, 23 insertions(+), 1 deletion(-) (limited to 'catalog-be/src') diff --git a/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/files/default/error-configuration.yaml b/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/files/default/error-configuration.yaml index 4f5374fa3c..9d3204b732 100644 --- a/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/files/default/error-configuration.yaml +++ b/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/files/default/error-configuration.yaml @@ -2595,4 +2595,20 @@ errors: code: 400, message: "Invalid label name. Only the following characters are allowed in label name: '%1'", messageId: "SVC4158" + } + + #---------SVC4159----------------------------- + # %1 - The model name + COULD_NOT_DELETE_MODEL: { + code: 500, + message: "Could not delete the model '%1'.", + messageId: "SVC4159" + } + + #---------SVC4160----------------------------- + # %1 - The model name + COULD_NOT_DELETE_MODEL_ELEMENTS: { + code: 500, + message: "Could not delete the model '%1' elements.", + messageId: "SVC4160" } \ No newline at end of file diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/UndoCheckoutTransition.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/UndoCheckoutTransition.java index c8b50d28a6..f1ea1eef9a 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/UndoCheckoutTransition.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/UndoCheckoutTransition.java @@ -106,7 +106,7 @@ public class UndoCheckoutTransition extends LifeCycleTransition { Either result = null; log.debug("start performing undo-checkout for resource {}", component.getUniqueId()); try { - Either undoCheckoutResourceResult = lifeCycleOperation.undoCheckout(component.getUniqueId()); + Either undoCheckoutResourceResult = lifeCycleOperation.undoCheckout(component.getUniqueId(), component.getModel()); if (undoCheckoutResourceResult.isRight()) { log.debug("checkout failed on graph"); StorageOperationStatus response = undoCheckoutResourceResult.right().value(); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ArchiveEndpointTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ArchiveEndpointTest.java index 18cdb424f6..2de9000145 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ArchiveEndpointTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ArchiveEndpointTest.java @@ -92,6 +92,7 @@ import org.openecomp.sdc.be.model.jsonjanusgraph.operations.TopologyTemplateOper import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade; import org.openecomp.sdc.be.model.operations.api.IGraphLockOperation; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; +import org.openecomp.sdc.be.model.operations.impl.ModelElementOperation; import org.openecomp.sdc.be.model.operations.impl.ModelOperation; import org.openecomp.sdc.be.servlets.exception.ComponentExceptionMapper; import org.openecomp.sdc.be.servlets.exception.DefaultExceptionMapper; @@ -267,6 +268,11 @@ class ArchiveEndpointTest extends JerseyTest { return new ModelOperation(null, null, null, null); } + @Bean + ModelElementOperation modelElementOperation() { + return new ModelElementOperation(null, null, null); + } + private void initGraphForTest() { //Create Catalog Root catalogVertex = GraphTestUtils.createRootCatalogVertex(janusGraphDao); -- cgit 1.2.3-korg