Search in sources :

Example 11 with Workflow

use of org.onap.so.db.catalog.beans.Workflow in project so by onap.

the class InstanceManagement method getCustomWorkflowUri.

private RecipeLookupResult getCustomWorkflowUri(String workflowUuid) {
    Workflow workflow = catalogDbClient.findWorkflowByArtifactUUID(workflowUuid);
    if (workflow != null) {
        String workflowName = workflow.getName();
        String recipeUri = "/mso/async/services/" + workflowName;
        return new RecipeLookupResult(recipeUri, 180);
    }
    return null;
}
Also used : Workflow(org.onap.so.db.catalog.beans.Workflow)

Example 12 with Workflow

use of org.onap.so.db.catalog.beans.Workflow in project so by onap.

the class InstanceManagement method setWorkflowNameAndOperationName.

protected InfraActiveRequests setWorkflowNameAndOperationName(InfraActiveRequests currentActiveReq, String workflowUuid) {
    Workflow workflow = catalogDbClient.findWorkflowByArtifactUUID(workflowUuid);
    if (workflow != null) {
        currentActiveReq.setWorkflowName(workflow.getName());
        currentActiveReq.setOperationName(workflow.getOperationName());
    }
    return currentActiveReq;
}
Also used : Workflow(org.onap.so.db.catalog.beans.Workflow)

Example 13 with Workflow

use of org.onap.so.db.catalog.beans.Workflow in project so by onap.

the class WorkflowRepositoryTest method findByArtifactUuid_ValidUuid_ExpectedOutput.

@Test
public void findByArtifactUuid_ValidUuid_ExpectedOutput() throws Exception {
    Workflow workflow = workflowRepository.findByArtifactUUID("5b0c4322-643d-4c9f-b184-4516049e99b1");
    assertEquals("artifactName", "testingWorkflow.bpmn", workflow.getArtifactName());
}
Also used : Workflow(org.onap.so.db.catalog.beans.Workflow) BaseTest(org.onap.so.db.catalog.BaseTest) Test(org.junit.Test)

Example 14 with Workflow

use of org.onap.so.db.catalog.beans.Workflow in project so by onap.

the class CatalogDbClientTest method testFindWorkflowByPnfModelUUID.

@Test
public final void testFindWorkflowByPnfModelUUID() {
    String pnfResourceModelUUID = "f2d1f2b2-88bb-49da-b716-36ae420ccbff";
    doReturn(new ArrayList()).when(catalogDbClient).getMultipleResources(any(), any());
    List<Workflow> results = catalogDbClient.findWorkflowByPnfModelUUID(pnfResourceModelUUID);
    verify(catalogDbClient).getMultipleResources(any(Client.class), eq(UriBuilder.fromUri("/findWorkflowByPnfModelUUID").queryParam(CatalogDbClient.PNF_RESOURCE_MODEL_UUID, pnfResourceModelUUID).build()));
}
Also used : ArrayList(java.util.ArrayList) Workflow(org.onap.so.db.catalog.beans.Workflow) Client(uk.co.blackpepper.bowman.Client) Test(org.junit.Test)

Aggregations

Workflow (org.onap.so.db.catalog.beans.Workflow)14 Test (org.junit.Test)9 ArrayList (java.util.ArrayList)4 CatalogDbAdapterBaseTest (org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest)3 Transactional (javax.transaction.Transactional)2 BaseTest (org.onap.so.asdc.BaseTest)2 VnfResourceWorkflow (org.onap.so.db.catalog.beans.VnfResourceWorkflow)2 WorkflowActivitySpecSequence (org.onap.so.db.catalog.beans.WorkflowActivitySpecSequence)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 File (java.io.File)1 Before (org.junit.Before)1 IArtifactInfo (org.onap.sdc.api.notification.IArtifactInfo)1 NotificationDataImpl (org.onap.so.asdc.client.test.emulators.NotificationDataImpl)1 BaseTaskTest (org.onap.so.bpmn.BaseTaskTest)1 BaseTest (org.onap.so.db.catalog.BaseTest)1 HttpEntity (org.springframework.http.HttpEntity)1 Client (uk.co.blackpepper.bowman.Client)1