diff options
author | mojahidi <mojahidul.islam@amdocs.com> | 2018-07-19 12:35:31 +0530 |
---|---|---|
committer | Avi Gaffa <avi.gaffa@amdocs.com> | 2018-07-30 10:03:24 +0000 |
commit | a8480d1fec5b5696be04eb887f4cbed6b56238be (patch) | |
tree | 59f3e71a9f780e3aee6519cfda4080a4ef356729 /catalog-be/src | |
parent | 734d54df49905998d1952a8a3b1a5caf38a05fa0 (diff) |
Add support for workflowId and workflowVersionId
Enhance operation data model and APIs to support workflowId and workflowVersionId
Change-Id: Ib8772027a3e0147ae0bb59811a9b31fe46975ac6
Issue-ID: SDC-1535
Signed-off-by: mojahidi <mojahidul.islam@amdocs.com>
Diffstat (limited to 'catalog-be/src')
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); |