diff options
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/test')
4 files changed, 23 insertions, 78 deletions
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidatorTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidatorTest.java index f6988fdcd4..81ec388649 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidatorTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidatorTest.java @@ -1,3 +1,23 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + package org.onap.so.bpmn.infrastructure.validations; import static org.junit.Assert.assertEquals; 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 @@ -83,54 +83,6 @@ public class WorkflowActionUnitTest { private WorkflowAction workflowAction; @Test - public void filterOrchFlowsHasFabricTest() { - - List<OrchestrationFlow> 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<OrchestrationFlow> result = workflowAction.filterOrchFlows(sIRequest, flows, WorkflowType.VFMODULE, mock(DelegateExecution.class)); - - assertThat(result, is(flows)); - } - - @Test - public void filterOrchFlowNoFabricTest() { - List<OrchestrationFlow> 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<OrchestrationFlow> result = workflowAction.filterOrchFlows(sIRequest, flows, WorkflowType.VFMODULE, mock(DelegateExecution.class)); - List<OrchestrationFlow> expected = createFlowList( - "flow x", - "flow y", - "flow z"); - - assertThat(result, is(expected)); - } - - @Test public void traverseCatalogDbForConfigurationTest() { CvnfcCustomization cvnfcCustomization = new CvnfcCustomization(); @@ -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<OrchestrationFlow> 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))); } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapperTest.java index 3bb54278b6..630bccee9d 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapperTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapperTest.java @@ -362,7 +362,7 @@ public class GeneralTopologyObjectMapperTest extends TestDataSetup { assertNull(gcRequestInput.getOnapModelInformation()); assertEquals(vfModule.getVfModuleId(),gcRequestInput.getVfModuleId()); assertNotNull(gcRequestInput.getVfModuleId()); - assertFalse(gcRequestInput.getFromPreload()); + assertTrue(gcRequestInput.getFromPreload()); } @Test @@ -386,7 +386,7 @@ public class GeneralTopologyObjectMapperTest extends TestDataSetup { assertNull(gcRequestInput.getOnapModelInformation()); assertEquals(vfModule.getVfModuleId(),gcRequestInput.getVfModuleId()); assertNotNull(gcRequestInput.getVfModuleId()); - assertFalse(gcRequestInput.getFromPreload()); + assertTrue(gcRequestInput.getFromPreload()); } @Test diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationUnassign.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationUnassign.json index cecb4c1dc7..c28b0fa689 100644 --- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationUnassign.json +++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationUnassign.json @@ -22,7 +22,7 @@ }, "vf-module-information" : { "vf-module-id" : "testVfModuleId", - "from-preload": false + "from-preload": true }, "vnf-information" : { "vnf-id" : "testVnfId", |