diff options
author | Yaoguang Wang <sunshine.wang@huawei.com> | 2020-02-13 17:41:38 +0800 |
---|---|---|
committer | Yaoguang Wang <sunshine.wang@huawei.com> | 2020-02-18 16:17:19 +0800 |
commit | bba9db24305b78214fd9f415d2ab4d7455ee762c (patch) | |
tree | 6b2ef53a794c54dc84029c3b9e2a44aa4b7ec636 /mso-catalog-db/src | |
parent | c3c1ffae16d32747dc380a8311d3829d0e0cbd35 (diff) |
extend query parameter to support pnfModelVersionId
Issue-ID: SO-2559
Signed-off-by: Yaoguang Wang <sunshine.wang@huawei.com>
Change-Id: I51cb15f6750b378a9de3435951e3ea1644184a55
Diffstat (limited to 'mso-catalog-db/src')
3 files changed, 8 insertions, 7 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 161ca2a2fb..4090e19d34 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 @@ -201,7 +201,7 @@ public class CatalogDbClient { private String findServiceByServiceInstanceId = "/findServiceByServiceInstanceId"; private String findPnfResourceCustomizationByModelUuid = "/findPnfResourceCustomizationByModelUuid"; private String findWorkflowByArtifactUUID = "/findByArtifactUUID"; - private String findWorkflowByModelUUID = "/findWorkflowByModelUUID"; + private String findWorkflowByVnfModelUUID = "/findWorkflowByVnfModelUUID"; private String findWorkflowByPnfModelUUID = "/findWorkflowByPnfModelUUID"; private String findWorkflowBySource = "/findBySource"; private String findVnfResourceCustomizationByModelUuid = "/findVnfResourceCustomizationByModelUuid"; @@ -339,7 +339,7 @@ public class CatalogDbClient { endpoint + PNF_RESOURCE_CUSTOMIZATION + SEARCH + findPnfResourceCustomizationByModelUuid; findWorkflowByArtifactUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByArtifactUUID; - findWorkflowByModelUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByModelUUID; + findWorkflowByVnfModelUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByVnfModelUUID; findWorkflowByPnfModelUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByPnfModelUUID; findWorkflowBySource = endpoint + WORKFLOW + SEARCH + findWorkflowBySource; @@ -1049,8 +1049,8 @@ public class CatalogDbClient { .queryParam(ARTIFACT_UUID, artifactUUID).build().toString())); } - public List<Workflow> findWorkflowByModelUUID(String vnfResourceModelUUID) { - return this.getMultipleResources(workflowClient, getUri(UriBuilder.fromUri(findWorkflowByModelUUID) + public List<Workflow> findWorkflowByVnfModelUUID(String vnfResourceModelUUID) { + return this.getMultipleResources(workflowClient, getUri(UriBuilder.fromUri(findWorkflowByVnfModelUUID) .queryParam(VNF_RESOURCE_MODEL_UUID, vnfResourceModelUUID).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 f1b399325e..91c6940e95 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 @@ -37,14 +37,14 @@ public interface WorkflowRepository extends JpaRepository<Workflow, Integer> { * Used to fetch the @{link Workflow} by the Model UUID. * * This operation is required by {@link org.onap.so.db.catalog.client.CatalogDbClient} to provide Workflow based on - * model UUID without projection. + * vnf model UUID without projection. * * @param vnfResourceModelUUID UUID * @return List of Workflow */ @Query(value = "select b.* from vnf_resource_to_workflow a join workflow b where a.WORKFLOW_ID = b.ID and a.VNF_RESOURCE_MODEL_UUID = ?1", nativeQuery = true) - List<Workflow> findWorkflowByModelUUID(String vnfResourceModelUUID); + List<Workflow> findWorkflowByVnfModelUUID(String vnfResourceModelUUID); /** * Used to fetch the @{link Workflow} by the Pnf 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 7d1b8d0d96..b07e82b8a8 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 @@ -36,7 +36,8 @@ public class WorkflowRepositoryTest extends BaseTest { @Test public void findByVnfResourceModelUUIDTest() throws Exception { - List<Workflow> workflows = workflowRepository.findWorkflowByModelUUID("ff2ae348-214a-11e7-93ae-92361f002671"); + List<Workflow> workflows = + workflowRepository.findWorkflowByVnfModelUUID("ff2ae348-214a-11e7-93ae-92361f002671"); Assert.assertTrue(workflows != null); Assert.assertTrue(workflows.size() != 0); |