Use workflow's name for invocation 08/87708/2
authorElena Kuleshov <evn@att.com>
Thu, 9 May 2019 16:27:30 +0000 (12:27 -0400)
committerMarcus Williams <marcus.williams@intel.com>
Wed, 15 May 2019 13:33:23 +0000 (13:33 +0000)
Use workflow's name for invocation

Change-Id: Ie527788f029bdccc91f7f406df0a478e55375c01
Issue-ID: SO-1876
Signed-off-by: Kuleshov, Elena <evn@att.com>
adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql
asdc-controller/src/test/resources/data.sql
mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java
mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_Response.json
mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/WorkflowRepositoryTest.java
mso-catalog-db/src/test/resources/data.sql

index 9265e5a..d8d9ee1 100644 (file)
@@ -649,7 +649,7 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
     @Test
     public void getWorkflowByArtifactUUID_validUuid_expectedOutput() {
         Workflow workflow = client.findWorkflowByArtifactUUID("5b0c4322-643d-4c9f-b184-4516049e99b1");
-        assertEquals("artifactName", "testingWorkflow", workflow.getArtifactName());
+        assertEquals("artifactName", "testingWorkflow.bpmn", workflow.getArtifactName());
     }
 
     @Test
@@ -664,7 +664,7 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
         assertTrue(workflows != null);
         assertTrue(workflows.size() != 0);
 
-        assertEquals("testingWorkflow", workflows.get(0).getArtifactName());
+        assertEquals("testingWorkflow.bpmn", workflows.get(0).getArtifactName());
     }
 
     @Test
@@ -679,7 +679,7 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
         assertTrue(workflows != null);
         assertTrue(workflows.size() != 0);
 
-        assertEquals("testingWorkflow", workflows.get(0).getArtifactName());
+        assertEquals("testingWorkflow.bpmn", workflows.get(0).getArtifactName());
     }
 
     @Test
index 0229dd0..1ba1597 100644 (file)
@@ -225,7 +225,7 @@ insert into pnf_resource_customization_to_service(service_model_uuid, resource_m
 ('5df8b6de-2083-11e7-93ae-92361f002676', '68dc9a92-214c-11e7-93ae-92361f002680');
 
 insert into workflow(artifact_uuid, artifact_name, name, operation_name, version, description, body, resource_target, source) values
-('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc');
+('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow.bpmn', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc');
 
 insert into vnf_resource_to_workflow(vnf_resource_model_uuid, workflow_id) values
 ('ff2ae348-214a-11e7-93ae-92361f002671', '1');
index 47e6c4c..c9179fe 100644 (file)
@@ -26,7 +26,7 @@ insert into vnf_resource(orchestration_mode, description, creation_timestamp, mo
 ('HEAT', '1607 vSAMP10a - inherent network', '2017-04-14 21:46:28', 'ff2ae348-214a-11e7-93ae-92361f002671', '', '', '2fff5b20-214b-11e7-93ae-92361f002671', '1.0', 'vSAMP10a', 'VF', null);
 
 insert into workflow(artifact_uuid, artifact_name, name, operation_name, version, description, body, resource_target, source) values
-('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc');
+('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow.bpmn', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc');
 
 insert into vnf_resource_to_workflow(vnf_resource_model_uuid, workflow_id) values
 ('ff2ae348-214a-11e7-93ae-92361f002671', '1');
index c491444..dd6050b 100644 (file)
@@ -255,7 +255,7 @@ public class InstanceManagement {
         if (workflow == null) {
             return null;
         } else {
-            String workflowName = workflow.getArtifactName();
+            String workflowName = workflow.getName();
             recipeUri = "/mso/async/services/" + workflowName;
         }
         return new RecipeLookupResult(recipeUri, 180);
index 6e358f7..d6ed585 100644 (file)
@@ -1,4 +1,5 @@
 {
   "artifactUUID": "71526781-e55c-4cb7-adb3-97e09d9c76be",
-  "artifactName": "testingWorkflow" 
+  "artifactName": "testingWorkflow.bpmn",
+  "name": "testingWorkflow" 
 }
\ No newline at end of file
index 171d4b2..7d1b8d0 100644 (file)
@@ -31,7 +31,7 @@ public class WorkflowRepositoryTest extends BaseTest {
     public void findByArtifactUuid_ValidUuid_ExpectedOutput() throws Exception {
         Workflow workflow = workflowRepository.findByArtifactUUID("5b0c4322-643d-4c9f-b184-4516049e99b1");
 
-        assertEquals("artifactName", "testingWorkflow", workflow.getArtifactName());
+        assertEquals("artifactName", "testingWorkflow.bpmn", workflow.getArtifactName());
     }
 
     @Test
@@ -41,7 +41,7 @@ public class WorkflowRepositoryTest extends BaseTest {
         Assert.assertTrue(workflows != null);
         Assert.assertTrue(workflows.size() != 0);
 
-        Assert.assertTrue("testingWorkflow".equals(workflows.get(0).getArtifactName()));
+        Assert.assertTrue("testingWorkflow.bpmn".equals(workflows.get(0).getArtifactName()));
     }
 
     @Test
@@ -51,7 +51,7 @@ public class WorkflowRepositoryTest extends BaseTest {
         Assert.assertTrue(workflows != null);
         Assert.assertTrue(workflows.size() != 0);
 
-        Assert.assertTrue("testingWorkflow".equals(workflows.get(0).getArtifactName()));
+        Assert.assertTrue("testingWorkflow.bpmn".equals(workflows.get(0).getArtifactName()));
     }
 
 }
index f6d0426..31f5920 100644 (file)
@@ -742,7 +742,7 @@ insert into pnf_resource_customization_to_service(service_model_uuid, resource_m
 ('5df8b6de-2083-11e7-93ae-92361f002676', '68dc9a92-214c-11e7-93ae-92361f002680');
 
 insert into workflow(artifact_uuid, artifact_name, name, operation_name, version, description, body, resource_target, source) values
-('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc');
+('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow.bpmn', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc');
 
 insert into vnf_resource_to_workflow(vnf_resource_model_uuid, workflow_id) values
 ('ff2ae348-214a-11e7-93ae-92361f002671', '1');