From 63bee11f255fcd2cc39a3d87c208aa6e517a8f85 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Sun, 20 Jan 2019 16:10:18 -0500 Subject: Bug fixes from AT&T January 20th sorted vfmodules by base last for negative action reqs store Response in execution as String on network delete added functionality to skip rollback based on flag # Conflicts: # bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflo w/tasks/WorkflowAction.java require XML in the header for delete network request Update APP-C LCM Client library version to 1.7.0. replaced wiremock style test with mockito test Handle AAIClient Exps in CreateCustomerV1 getServiceInstance() changed default status code to be configurable Replace vnfType by nfRole in the healthcheck request to SDNO. updated error messages in sdnc handler and flow status updated flow status message on completion of flow Send GenericVnf object for AAI VNF update for vnf-api updates Add a JUnit test file for SDNOValidatorImpl.java Set nodeType on the inner SDNO request as per update from SDNO. updated rollbackToAssigned logic to remove unassign flows updated sdnc handler error message for client error added exception handling for httpclienterror in sdnc out map workflow exception so error is reported throws sdnc error message on bad response from sdnc add catalog entries for TRANSPORT service delete flows change script number that was duplicate add find method to NorthBoundRequestRepository include serviceType in hash code use asterisk for all non-TRANSPORT flow db entries alacart true, rm not needed transport srvc model steps correct insert query syntax for orchestration_flow support serviceType (TRANSPORT) process flow fix SDNCAdapterException causing no callback to bpmn use JsonAlias for alternate case when deserializing GRM client will accept both "serviceEndPointList" and "ServiceEndPointList" root node in the JSON response. AAIRestClient now uses getSystemName in headers finishtime should not be returned in requeststatus Change-Id: I81a185252b057020f7f36f125c85c3357756da88 Issue-ID: SO-1403 Signed-off-by: Benjamin, Max (mb388a) --- .../workflow/tasks/WorkflowActionBBTasksTest.java | 25 +++++++++------------- .../workflow/tasks/WorkflowActionTest.java | 11 ++++++++++ .../workflow/tasks/WorkflowActionUnitTest.java | 2 +- 3 files changed, 22 insertions(+), 16 deletions(-) (limited to 'bpmn/so-bpmn-tasks/src/test/java') diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java index 5c1485979e..f3b094f645 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java @@ -21,9 +21,9 @@ package org.onap.so.bpmn.infrastructure.workflow.tasks; import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.anyString; -import static org.mockito.Matchers.isA; +import static org.mockito.ArgumentMatchers.anyObject; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.when; @@ -258,33 +258,28 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { List flowsToExecute = new ArrayList(); ExecuteBuildingBlock ebb1 = new ExecuteBuildingBlock(); BuildingBlock bb1 = new BuildingBlock(); - bb1.setBpmnFlowName("AssignServiceInstanceBB"); + bb1.setBpmnFlowName("AssignVfModuleBB"); ebb1.setBuildingBlock(bb1); flowsToExecute.add(ebb1); ExecuteBuildingBlock ebb2 = new ExecuteBuildingBlock(); BuildingBlock bb2 = new BuildingBlock(); - bb2.setBpmnFlowName("CreateNetworkCollectionBB"); + bb2.setBpmnFlowName("CreateVfModuleBB"); ebb2.setBuildingBlock(bb2); flowsToExecute.add(ebb2); ExecuteBuildingBlock ebb3 = new ExecuteBuildingBlock(); BuildingBlock bb3 = new BuildingBlock(); - bb3.setBpmnFlowName("AssignNetworkBB"); + bb3.setBpmnFlowName("ActivateVfModuleBB"); ebb3.setBuildingBlock(bb3); flowsToExecute.add(ebb3); - ExecuteBuildingBlock ebb4 = new ExecuteBuildingBlock(); - BuildingBlock bb4 = new BuildingBlock(); - bb4.setBpmnFlowName("CreateNetworkBB"); - ebb4.setBuildingBlock(bb4); - flowsToExecute.add(ebb4); execution.setVariable("flowsToExecute", flowsToExecute); - execution.setVariable("gCurrentSequence", 3); - doNothing().when(workflowActionBBFailure).updateRequestErrorStatusMessage(isA(DelegateExecution.class)); - + execution.setVariable("gCurrentSequence", 2); + workflowActionBBTasks.rollbackExecutionPath(execution); List ebbs = (List) execution.getVariable("flowsToExecute"); - assertEquals(ebbs.get(0).getBuildingBlock().getBpmnFlowName(),"DeleteNetworkCollectionBB"); + assertEquals("DeleteVfModuleBB",ebbs.get(0).getBuildingBlock().getBpmnFlowName()); assertEquals(0,execution.getVariable("gCurrentSequence")); + assertEquals(1,ebbs.size()); } @Test diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java index 72f0ce4e6d..7b348c8cb3 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java @@ -982,6 +982,17 @@ public class WorkflowActionTest extends BaseTaskTest { assertEquals(flows.get(8).getFlowName(),"SDNOVnfHealthCheckBB"); assertEquals(flows.get(9).getFlowName(),"AAIUnsetVnfInMaintBB"); } + + @Test + public void queryNorthBoundRequestCatalogDbTransportTest() throws MalformedURLException { + NorthBoundRequest northBoundRequest = new NorthBoundRequest(); + List orchFlows = createFlowList("AssignServiceInstanceBB"); + northBoundRequest.setOrchestrationFlowList(orchFlows); + when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwnerAndServiceType("createInstance","Service",true,"my-custom-cloud-owner","TRANSPORT")).thenReturn(northBoundRequest); + + List flows = workflowAction.queryNorthBoundRequestCatalogDb(execution, "createInstance", WorkflowType.SERVICE, true,"my-custom-cloud-owner","TRANSPORT"); + assertEquals(flows.get(0).getFlowName(),"AssignServiceInstanceBB"); + } @Test public void extractResourceIdAndTypeFromUriTest(){ 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 4008240203..297d75a104 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 @@ -144,7 +144,7 @@ public class WorkflowActionUnitTest { flow.setFlowName("flow x"); List flows = Arrays.asList(flow); - doReturn(Arrays.asList(flow)).when(workflowAction).queryNorthBoundRequestCatalogDb(any(), any(), any(), anyBoolean(), any()); + doReturn(Arrays.asList(flow)).when(workflowAction).queryNorthBoundRequestCatalogDb(any(), any(), any(), anyBoolean(), any(), any()); workflowAction.selectExecutionList(execution); verify(workflowAction, times(1)).filterOrchFlows(eq(flows), any(), any()); -- cgit 1.2.3-korg