From 6adb4ab50bd5c2e32ea0b57fe5a3ba5b7238e57a Mon Sep 17 00:00:00 2001 From: "Smokowski, Steve (ss835w)" Date: Wed, 5 Dec 2018 09:38:22 -0500 Subject: Add Cloud Owner Update ref data, turn test into integration test Fixed junit test to use cloudOwner as "my-custom-cloud-owner". Fixed junit test case for the new method. updates to the junit test case for Update WorkflowAction.queryNorthBoundRequestCatalogDb to have cloud-owner as a param Add a new method to CatalogDBClient- getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner() Update Repeatable Migration to have CloudOwner Populated for all Records Add New Migration Script to Add Cloud_Owner Column to North_Bound_Request Table Add Cloud_Owner Field to Java Bean, as a String Change-Id: I9f135be8923626c6d6f6b4ae23e4cbc0200067e2 Issue-ID: SO-1276 Signed-off-by: Smokowski, Steve (ss835w) --- .../so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'bpmn/so-bpmn-tasks/src/main/java') diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index e9dcdade9f..3e1673017e 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -89,6 +89,7 @@ public class WorkflowAction { private static final String G_REQUEST_ID = "mso-request-id"; private static final String G_BPMN_REQUEST = "bpmnRequest"; private static final String G_ALACARTE = "aLaCarte"; + private static final String CLOUD_OWNER = "cloudOwner"; private static final String G_APIVERSION = "apiVersion"; private static final String G_URI = "requestUri"; private static final String G_ISTOPLEVELFLOW = "isTopLevelFlow"; @@ -133,6 +134,7 @@ public class WorkflowAction { final String bpmnRequest = (String) execution.getVariable(G_BPMN_REQUEST); final boolean aLaCarte = (boolean) execution.getVariable(G_ALACARTE); final String apiVersion = (String) execution.getVariable(G_APIVERSION); + final String cloudOwner = (String) execution.getVariable(CLOUD_OWNER); final String uri = (String) execution.getVariable(G_URI); final String vnfType = (String) execution.getVariable(VNF_TYPE); List orchFlows = (List) execution.getVariable(G_ORCHESTRATION_FLOW); @@ -165,7 +167,7 @@ public class WorkflowAction { if (aLaCarte) { if (orchFlows == null || orchFlows.isEmpty()) { - orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte); + orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte, cloudOwner); } orchFlows = filterOrchFlows(orchFlows, resourceType, execution); String key = ""; @@ -249,7 +251,7 @@ public class WorkflowAction { logger.info("Found {}", foundObjects); if (orchFlows == null || orchFlows.isEmpty()) { - orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte); + orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte, cloudOwner); } flowsToExecute = buildExecuteBuildingBlockList(orchFlows, resourceCounter, requestId, apiVersion, resourceId, resourceType, requestAction, aLaCarte, vnfType, workflowResourceIds, requestDetails); @@ -943,10 +945,10 @@ public class WorkflowAction { } protected List queryNorthBoundRequestCatalogDb(DelegateExecution execution, String requestAction, - WorkflowType resourceName, boolean aLaCarte) { + WorkflowType resourceName, boolean aLaCarte, String cloudOwner) { List listToExecute = new ArrayList<>(); NorthBoundRequest northBoundRequest = catalogDbClient - .getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(requestAction, resourceName.toString(), aLaCarte); + .getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(requestAction, resourceName.toString(), aLaCarte, cloudOwner); if(northBoundRequest == null){ if(aLaCarte){ buildAndThrowException(execution,"The request: ALaCarte " + resourceName + " " + requestAction + " is not supported by GR_API."); -- cgit 1.2.3-korg