From 0b906b0de95725879fd1cc7ad585d71c502eebd9 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Thu, 14 Mar 2019 16:02:18 -0400 Subject: Added vnfc support to BB layer added vnfc to gbb for execute bb and bb layer enhance workflow action layer to handle vnfcs Change-Id: I0d39c3aefe66180ed6f2b75a0c946e07ca603261 Issue-ID: SO-1658 Signed-off-by: Benjamin, Max (mb388a) --- .../workflow/tasks/WorkflowActionUnitTest.java | 75 ---------------------- 1 file changed, 75 deletions(-) (limited to 'bpmn/so-bpmn-tasks/src/test/java/org') diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java index 8195cd58c0..5c083779be 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java @@ -82,54 +82,6 @@ public class WorkflowActionUnitTest { @Spy private WorkflowAction workflowAction; - @Test - public void filterOrchFlowsHasFabricTest() { - - List flows = createFlowList( - "DeactivateFabricConfigurationBB", - "flow x", - "flow y", - "ActivateFabricConfigurationBB", - "flow z"); - doReturn(Arrays.asList("yes", "yes")).when(workflowAction).traverseCatalogDbForConfiguration(ArgumentMatchers.any(String.class), ArgumentMatchers.isNull()); - - ServiceInstancesRequest sIRequest = new ServiceInstancesRequest(); - RequestDetails requestDetails = new RequestDetails(); - ModelInfo modelInfo = new ModelInfo(); - requestDetails.setModelInfo(modelInfo); - RelatedInstance relatedInstance = new RelatedInstance(); - sIRequest.setRequestDetails(requestDetails); - - List result = workflowAction.filterOrchFlows(sIRequest, flows, WorkflowType.VFMODULE, mock(DelegateExecution.class)); - - assertThat(result, is(flows)); - } - - @Test - public void filterOrchFlowNoFabricTest() { - List flows = createFlowList( - "DeactivateFabricConfigurationBB", - "flow x", - "flow y", - "ActivateFabricConfigurationBB", - "flow z"); - - ServiceInstancesRequest sIRequest = new ServiceInstancesRequest(); - RequestDetails requestDetails = new RequestDetails(); - ModelInfo modelInfo = new ModelInfo(); - modelInfo.setModelCustomizationUuid(""); - requestDetails.setModelInfo(modelInfo); - sIRequest.setRequestDetails(requestDetails); - - List result = workflowAction.filterOrchFlows(sIRequest, flows, WorkflowType.VFMODULE, mock(DelegateExecution.class)); - List expected = createFlowList( - "flow x", - "flow y", - "flow z"); - - assertThat(result, is(expected)); - } - @Test public void traverseCatalogDbForConfigurationTest() { @@ -150,33 +102,6 @@ public class WorkflowActionUnitTest { } - @Test - public void verifyFilterOrchInvocation() throws Exception { - DelegateExecution execution = mock(DelegateExecution.class); - - when(execution.getVariable(eq("aLaCarte"))).thenReturn(true); - when(execution.getVariable(eq("bpmnRequest"))).thenReturn(getJson("ServiceMacroAssign.json")); - when(execution.getVariable(eq("requestUri"))).thenReturn("/v6/serviceInstances/123/vnfs/1234"); - - OrchestrationFlow flow = new OrchestrationFlow(); - flow.setFlowName("flow x"); - - List flows = Arrays.asList(flow); - doReturn(Arrays.asList(flow)).when(workflowAction).queryNorthBoundRequestCatalogDb(any(), any(), any(), anyBoolean(), any(), any()); - workflowAction.selectExecutionList(execution); - - verify(workflowAction, times(1)).filterOrchFlows(any(), eq(flows), any(), any()); - - flow = new OrchestrationFlow(); - flow.setFlowName("flow y"); - flows = Arrays.asList(flow); - when(execution.getVariable(eq("aLaCarte"))).thenReturn(false); - workflowAction.selectExecutionList(execution); - - verify(workflowAction, never()).filterOrchFlows(any(), eq(flows), any(), any()); - - } - private String getJson(String filename) throws IOException { return new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + filename))); } -- cgit 1.2.3-korg