diff options
Diffstat (limited to 'asdctool')
2 files changed, 26 insertions, 5 deletions
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710.java index c63749e0d6..bff30683ca 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710.java @@ -12,6 +12,7 @@ import org.openecomp.sdc.asdctool.migration.tasks.handlers.XlsOutputHandler; import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic; import org.openecomp.sdc.be.components.impl.ResourceBusinessLogic; import org.openecomp.sdc.be.components.impl.ServiceBusinessLogic; +import org.openecomp.sdc.be.components.impl.exceptions.ByResponseFormatComponentException; import org.openecomp.sdc.be.components.impl.exceptions.ComponentException; import org.openecomp.sdc.be.components.lifecycle.LifecycleBusinessLogic; import org.openecomp.sdc.be.components.lifecycle.LifecycleChangeInfoWithAction; @@ -732,7 +733,7 @@ public class UpgradeMigration1710 implements PostMigration { resourceToUpdate.setCategories(((Resource)checkouRes.left().value()).getCategories()); try { Resource updateResourceFromCsarRes = resourceBusinessLogic.validateAndUpdateResourceFromCsar(resourceToUpdate, user, null, null, resourceToUpdate.getUniqueId()); - } catch(ComponentException e){ + } catch(ByResponseFormatComponentException e){ outputHandler.addRecord(resourceToUpdate.getComponentType().name(), resourceToUpdate.getName(), resourceToUpdate.getUUID(), resourceToUpdate.getUniqueId(), MigrationResult.MigrationStatus.FAILED.name(), e.getResponseFormat().getFormattedMessage()); log.info("Failed to update vf with name {}, invariantUUID {}, version {} and latest VSP {}. ", vf.getName(), vf.getInvariantUUID(), vf.getVersion(), latestVersion); return false; diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710Test.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710Test.java index df5761d893..8d46e61011 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710Test.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710Test.java @@ -1,6 +1,26 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * Modifications copyright (c) 2019 Nokia + * ================================================================================ + */ package org.openecomp.sdc.asdctool.migration.tasks.mig1710; - import com.google.common.collect.Lists; import fj.data.Either; import org.junit.AfterClass; @@ -15,7 +35,7 @@ import org.openecomp.sdc.asdctool.migration.core.task.MigrationResult; import org.openecomp.sdc.asdctool.migration.tasks.handlers.XlsOutputHandler; import org.openecomp.sdc.be.components.impl.ResourceBusinessLogic; import org.openecomp.sdc.be.components.impl.ServiceBusinessLogic; -import org.openecomp.sdc.be.components.impl.exceptions.ComponentException; +import org.openecomp.sdc.be.components.impl.exceptions.ByResponseFormatComponentException; import org.openecomp.sdc.be.components.lifecycle.LifecycleBusinessLogic; import org.openecomp.sdc.be.components.scheduledtasks.ComponentsCleanBusinessLogic; import org.openecomp.sdc.be.config.Configuration; @@ -291,7 +311,7 @@ public class UpgradeMigration1710Test { mockCheckoutFlow(); when(resourceBusinessLogic.validateAndUpdateResourceFromCsar(any(Resource.class), any(), any(), any(), any())) - .thenThrow(new ComponentException(responseFormat)); + .thenThrow(new ByResponseFormatComponentException(responseFormat)); when(resourceBusinessLogic.deleteResource(anyString(), any())) .thenReturn(responseFormat); mockChangeComponentState(); @@ -304,7 +324,7 @@ public class UpgradeMigration1710Test { mockCheckoutFlow(); when(resourceBusinessLogic.validateAndUpdateResourceFromCsar(any(Resource.class), any(), any(), any(), any())) - .thenThrow(new ComponentException(responseFormat)); + .thenThrow(new ByResponseFormatComponentException(responseFormat)); when(resourceBusinessLogic.deleteResource(anyString(), any())) .thenReturn(responseFormat); mockChangeComponentState(); |