diff options
Diffstat (limited to 'adapters/mso-catalog-db-adapter/src/test')
2 files changed, 18 insertions, 3 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java index 858216fd27..f65f521605 100644 --- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java +++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java @@ -652,7 +652,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 @@ -667,7 +667,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 @@ -676,4 +676,19 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest { Assert.assertNull(workflow); } + @Test + public void getWorkflowBySource_validSource_expectedOutput() { + List<Workflow> workflows = client.findWorkflowBySource("sdc"); + assertTrue(workflows != null); + assertTrue(workflows.size() != 0); + + assertEquals("testingWorkflow.bpmn", workflows.get(0).getArtifactName()); + } + + @Test + public void getWorkflowBySource_invalidSource_nullOutput() { + List<Workflow> workflow = client.findWorkflowBySource("abc"); + Assert.assertNull(workflow); + } + } diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql index 0e981f2b70..58b2983f82 100644 --- a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql +++ b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql @@ -228,7 +228,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'); |