summaryrefslogtreecommitdiffstats
path: root/mso-catalog-db
diff options
context:
space:
mode:
authorElena Kuleshov <evn@att.com>2019-05-05 07:51:49 -0400
committerElena Kuleshov <evn@att.com>2019-05-05 07:53:55 -0400
commiteee110cb38b47745cadc65ca7cbb5c64a1965418 (patch)
treeab9e4cc99afeb7f90578681bdcd0365f9e47db38 /mso-catalog-db
parent5e1bc9f09bec49b57bde13a1c96158eb2b8290da (diff)
Fix deployment of workflows on start
Fix deployment of workflows on start Change-Id: Iaa5cb96020da20c96bedb81e0829f73c7461b67f Issue-ID: SO-1837 Signed-off-by: Kuleshov, Elena <evn@att.com>
Diffstat (limited to 'mso-catalog-db')
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java8
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java2
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/WorkflowRepositoryTest.java10
3 files changed, 20 insertions, 0 deletions
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
index 19200468ae..ab5fdb939c 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
@@ -145,6 +145,7 @@ public class CatalogDbClient {
private static final String CLOUD_VERSION = "cloudVersion";
private static final String HOMING_INSTANCE = "/homingInstance";
private static final String ARTIFACT_UUID = "artifactUUID";
+ private static final String SOURCE = "source";
private static final String TARGET_ENTITY = "SO:CatalogDB";
private static final String ASTERISK = "*";
@@ -191,6 +192,7 @@ public class CatalogDbClient {
private String findPnfResourceCustomizationByModelUuid = "/findPnfResourceCustomizationByModelUuid";
private String findWorkflowByArtifactUUID = "/findByArtifactUUID";
private String findWorkflowByModelUUID = "/findWorkflowByModelUUID";
+ private String findWorkflowBySource = "/findBySource";
private String findVnfResourceCustomizationByModelUuid = "/findVnfResourceCustomizationByModelUuid";
private String serviceURI;
@@ -333,6 +335,7 @@ public class CatalogDbClient {
findWorkflowByArtifactUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByArtifactUUID;
findWorkflowByModelUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByModelUUID;
+ findWorkflowBySource = endpoint + WORKFLOW + SEARCH + findWorkflowBySource;
findVnfResourceCustomizationByModelUuid =
endpoint + VNF_RESOURCE_CUSTOMIZATION + SEARCH + findVnfResourceCustomizationByModelUuid;
@@ -889,4 +892,9 @@ public class CatalogDbClient {
return this.getMultipleResources(workflowClient, getUri(UriBuilder.fromUri(findWorkflowByModelUUID)
.queryParam(VNF_RESOURCE_MODEL_UUID, vnfResourceModelUUID).build().toString()));
}
+
+ public List<Workflow> findWorkflowBySource(String source) {
+ return this.getMultipleResources(workflowClient,
+ getUri(UriBuilder.fromUri(findWorkflowBySource).queryParam(SOURCE, source).build().toString()));
+ }
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java
index 89df52182c..8bcc60c8be 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java
@@ -31,6 +31,8 @@ public interface WorkflowRepository extends JpaRepository<Workflow, Integer> {
Workflow findByArtifactUUID(String artifactUUID);
+ List<Workflow> findBySource(String source);
+
/**
* Used to fetch the @{link Workflow} by the Model UUID.
*
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/WorkflowRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/WorkflowRepositoryTest.java
index 547b8e50a4..171d4b29f5 100644
--- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/WorkflowRepositoryTest.java
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/WorkflowRepositoryTest.java
@@ -44,4 +44,14 @@ public class WorkflowRepositoryTest extends BaseTest {
Assert.assertTrue("testingWorkflow".equals(workflows.get(0).getArtifactName()));
}
+ @Test
+ public void findBySourceTest() throws Exception {
+ List<Workflow> workflows = workflowRepository.findBySource("sdc");
+
+ Assert.assertTrue(workflows != null);
+ Assert.assertTrue(workflows.size() != 0);
+
+ Assert.assertTrue("testingWorkflow".equals(workflows.get(0).getArtifactName()));
+ }
+
}