diff options
author | Manamohan Satapathy <MS00534989@techmahindra.com> | 2019-03-26 14:39:52 +0530 |
---|---|---|
committer | Manamohan Satapathy <MS00534989@techmahindra.com> | 2019-03-26 14:40:15 +0530 |
commit | 28f62a251d2904dc3fdf6d33d0d5d4034c90efa0 (patch) | |
tree | fa7e561177cc4ed130e032e6205ea4c00fcff089 /bpmn/so-bpmn-tasks/src/test/java | |
parent | af46c0d4b30ecb5c8f36992e74adb86d7d5bbe06 (diff) |
Config Deploy
SO Generic Building Block to support config deploy action.
Change-Id: Ica02a1dae7ba542fad67a5258bc9b4e046d3468a
Issue-ID: SO-1482
Signed-off-by: Manamohan Satapathy <MS00534989@techmahindra.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/test/java')
2 files changed, 110 insertions, 0 deletions
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java index 78d08aa1f1..05af58040a 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java @@ -655,4 +655,17 @@ public class AAIUpdateTasksTest extends BaseTaskTest{ aaiUpdateTasks.updateManagementV6AddressVnf(execution); verify(aaiVnfResources, times(0)).updateObjectVnf(genericVnf); } + + @Test + public void updateOrchestrationStatusVnfConfigureTest() throws Exception { + doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.CONFIGURE); + + aaiUpdateTasks.updateOrchestrationStausConfigDeployConfigureVnf(execution); + } + @Test + public void updateOrchestrationStatusVnfConfiguredTest() throws Exception { + doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.CONFIGURED); + + aaiUpdateTasks.updateOrchestrationStausConfigDeployConfiguredVnf(execution); + } } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnfTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnfTest.java new file mode 100644 index 0000000000..e5aa702dad --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnfTest.java @@ -0,0 +1,97 @@ + +/* +* ============LICENSE_START======================================================= +* ONAP : SO +* ================================================================================ +* Copyright 2019 TechMahindra +*================================================================================= +* 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.flowspecific.tasks; + +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.when; + +import java.util.UUID; + +import org.camunda.bpm.engine.delegate.BpmnError; +import org.junit.Before; +import org.junit.Test; +import org.mockito.ArgumentMatchers; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.onap.so.bpmn.BaseTaskTest; +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.infrastructure.aai.tasks.AAIUpdateTasks; +import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf; +import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; +import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; +import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext; +import org.onap.so.client.exception.BBObjectNotFoundException; + +public class ConfigDeployVnfTest extends BaseTaskTest { + + @InjectMocks + private ConfigDeployVnf configDeployVnf = new ConfigDeployVnf(); + @Mock + AAIUpdateTasks aAIUpdateTasks = new AAIUpdateTasks(); + + + private GenericVnf genericVnf; + private ServiceInstance serviceInstance; + private RequestContext requestContext; + private String msoRequestId; + + @Before + public void before() throws BBObjectNotFoundException { + genericVnf = setGenericVnf(); + serviceInstance = setServiceInstance(); + msoRequestId = UUID.randomUUID().toString(); + requestContext = setRequestContext(); + requestContext.setMsoRequestId(msoRequestId); + gBBInput.setRequestContext(requestContext); + + doThrow(new BpmnError("BPMN Error")).when(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(Exception.class)); + when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(genericVnf); + when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.SERVICE_INSTANCE_ID))).thenReturn(serviceInstance); + } + + + + @Test + public void preProcessAbstractCDSProcessingTest() throws Exception { + + configDeployVnf.preProcessAbstractCDSProcessing(execution); + + assertTrue(true); + } + + @Test + public void updateAAIConfigureTaskTest() throws Exception { + + configDeployVnf.updateAAIConfigure(execution); + assertTrue(true); + } + + @Test + public void updateAAIConfiguredTaskTest() throws Exception { + configDeployVnf.updateAAIConfigured(execution); + assertTrue(true); + } + +} |