diff options
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceCapabilitiesPropertiesMerge.java')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceCapabilitiesPropertiesMerge.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceCapabilitiesPropertiesMerge.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceCapabilitiesPropertiesMerge.java index cf19a4d013..9c845046c0 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceCapabilitiesPropertiesMerge.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceCapabilitiesPropertiesMerge.java @@ -20,14 +20,13 @@ package org.openecomp.sdc.be.components.merge.instance; -import fj.data.Either; +import org.openecomp.sdc.be.components.impl.exceptions.ByActionStatusComponentException; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.model.CapabilityDefinition; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.User; -import org.openecomp.sdc.exception.ResponseFormat; import java.util.ArrayList; import java.util.Collection; @@ -54,11 +53,14 @@ public class ComponentInstanceCapabilitiesPropertiesMerge implements ComponentIn } @Override - public Either<Component, ResponseFormat> mergeDataAfterCreate(User user, DataForMergeHolder dataHolder, Component updatedContainerComponent, String newInstanceId) { + public Component mergeDataAfterCreate(User user, DataForMergeHolder dataHolder, Component updatedContainerComponent, String newInstanceId) { Component origInstanceNode = dataHolder.getOrigInstanceNode(); List<CapabilityDefinition> origInstanceCapabilities = dataHolder.getOrigInstanceCapabilities(); ActionStatus mergeStatus = capabilitiesPropertiesMergeBL.mergeComponentInstanceCapabilities(updatedContainerComponent, origInstanceNode, newInstanceId, origInstanceCapabilities); - return Either.iif(!ActionStatus.OK.equals(mergeStatus), () -> componentsUtils.getResponseFormat(mergeStatus), () -> updatedContainerComponent); + if(!ActionStatus.OK.equals(mergeStatus)){ + throw new ByActionStatusComponentException(mergeStatus); + } + return updatedContainerComponent; } private List<CapabilityDefinition> getAllInstanceCapabilities(ComponentInstance currentResourceInstance) { |