diff options
Diffstat (limited to 'catalog-be')
4 files changed, 18 insertions, 2 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogic.java index e61e925e97..3fd5df0ba9 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogic.java @@ -47,7 +47,7 @@ import java.util.*; @Component("interfaceOperationBusinessLogic") public class InterfaceOperationBusinessLogic extends ComponentBusinessLogic{ - private static final Logger LOGGER = LoggerFactory.getLogger(ResourceBusinessLogic.class); + private static final Logger LOGGER = LoggerFactory.getLogger(InterfaceOperationBusinessLogic.class); @Autowired private InterfaceOperationValidation interfaceOperationValidation; @@ -227,6 +227,9 @@ public class InterfaceOperationBusinessLogic extends ComponentBusinessLogic{ dbOperation.setName(updatedOperation.getName()); dbOperation.setDescription(updatedOperation.getDescription()); dbOperation.setInputs(updatedOperation.getInputs()); + dbOperation.setOutputs(updatedOperation.getOutputs()); + dbOperation.setWorkflowId(updatedOperation.getWorkflowId()); + dbOperation.setWorkflowVersionId(updatedOperation.getWorkflowVersionId()); return dbOperation; } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/InterfaceUIDataConverter.java b/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/InterfaceUIDataConverter.java index d7d2c6b7ef..98a49b023d 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/InterfaceUIDataConverter.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/InterfaceUIDataConverter.java @@ -56,6 +56,8 @@ public class InterfaceUIDataConverter { operationData.setUniqueId(interfaceOperation.getUniqueId()); operationData.setInputs(inputs); operationData.setOutputs(outputs); + operationData.setWorkflowId(interfaceOperation.getWorkflowId()); + operationData.setWorkflowVersionId(interfaceOperation.getWorkflowVersionId()); return operationData; } @@ -84,6 +86,8 @@ public class InterfaceUIDataConverter { interfaceOperationDataDefinition.setInputParams(inputParams); interfaceOperationDataDefinition.setOutputParams(outputParams); interfaceOperationDataDefinition.setArtifactUUID(operationData.getImplementation().getArtifactUUID()); + interfaceOperationDataDefinition.setWorkflowId(operationData.getWorkflowId()); + interfaceOperationDataDefinition.setWorkflowVersionId(operationData.getWorkflowVersionId()); return interfaceOperationDataDefinition; } diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/InterfaceOperationTestUtils.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/InterfaceOperationTestUtils.java index 61186f00d5..589e8be62b 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/InterfaceOperationTestUtils.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/InterfaceOperationTestUtils.java @@ -79,6 +79,8 @@ public interface InterfaceOperationTestUtils { implementation.setUniqueId("uniqId"); implementation.setArtifactUUID("artifactId"); operation.setImplementation(implementation); + operation.setWorkflowId("workflowId"); + operation.setWorkflowVersionId("workflowVersionId"); Map<String, Operation> operationMap = new HashMap<>(); operationMap.put("op1", operation); return operationMap; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogicTest.java index aa71d7616c..5df58cf6d9 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InterfaceOperationBusinessLogicTest.java @@ -43,6 +43,7 @@ import org.openecomp.sdc.be.impl.WebAppContextWrapper; import org.openecomp.sdc.be.model.*; import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache; import org.openecomp.sdc.be.model.jsontitan.operations.*; +import org.openecomp.sdc.be.model.jsontitan.utils.InterfaceUtils; import org.openecomp.sdc.be.model.operations.api.IElementOperation; import org.openecomp.sdc.be.model.operations.api.IPropertyOperation; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; @@ -208,9 +209,15 @@ public class InterfaceOperationBusinessLogicTest implements InterfaceOperationTe resourceUpdate = setUpResourceMock(); Either<Resource, ResponseFormat> interfaceOperation = bl.createInterfaceOperation(resourceId, resourceUpdate, user, true); Assert.assertTrue(interfaceOperation.isLeft()); + Map<String, Operation> interfaceOperationsFromInterfaces = InterfaceUtils + .getInterfaceOperationsFromInterfaces(interfaceOperation.left().value().getInterfaces(), + interfaceOperation.left().value()); + for(Operation operation : interfaceOperationsFromInterfaces.values()) { + Assert.assertNotNull(operation.getWorkflowId()); + Assert.assertNotNull(operation.getWorkflowVersionId()); + } } - @Test public void updateInterfaceOperationTest() { validateUserRoles(Role.ADMIN, Role.DESIGNER); |