aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-catalog-db-adapter/src
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-04-10 10:55:27 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-10 10:55:27 +0000
commit85f13e967a72a403af11cc0227996256a1495f40 (patch)
tree19a9ee46e40c27ee7d8f1c30c0128c6af1f4f6c8 /adapters/mso-catalog-db-adapter/src
parentb3820984a03241099f295930534e18b07d380f9d (diff)
parentfd4d683baf4344b058090e0b0203929103cacedf (diff)
Merge "Query CatalogDB for WorkflowSpecifications"
Diffstat (limited to 'adapters/mso-catalog-db-adapter/src')
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java15
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql3
2 files changed, 18 insertions, 0 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 e1152bad4a..51b44b0d3a 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
@@ -658,4 +658,19 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
Assert.assertNull(workflow);
}
+ @Test
+ public void getWorkflowByModelUUID_validUuid_expectedOutput() {
+ List<Workflow> workflows = client.findWorkflowByModelUUID("ff2ae348-214a-11e7-93ae-92361f002671");
+ assertTrue(workflows != null);
+ assertTrue(workflows.size() != 0);
+
+ assertEquals("testingWorkflow", workflows.get(0).getArtifactName());
+ }
+
+ @Test
+ public void getWorkflowByModelUUID_invalidUuid_nullOutput() {
+ Workflow workflow = client.findWorkflowByArtifactUUID(UUID.randomUUID().toString());
+ 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 af00732f2b..0229dd0d85 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
@@ -226,3 +226,6 @@ insert into pnf_resource_customization_to_service(service_model_uuid, resource_m
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');
+
+insert into vnf_resource_to_workflow(vnf_resource_model_uuid, workflow_id) values
+('ff2ae348-214a-11e7-93ae-92361f002671', '1');