From c5876cf77fc71e11f2f66dc308cde68d729261b4 Mon Sep 17 00:00:00 2001 From: "Smokowski, Steve (ss835w)" Date: Tue, 4 Dec 2018 13:35:01 -0500 Subject: Always UnAssign Removed logic to skip unassign sdnc in rollback flows Properly merge UT Class to remove test cases no longer needed Change-Id: I5041d6c828003aee953fb0cff3ac9e99f608ef10 Issue-ID: SO-1268 Signed-off-by: Smokowski, Steve (ss835w) --- .../sdnc/tasks/SDNCUnassignTasksTest.java | 57 +--------------------- 1 file changed, 1 insertion(+), 56 deletions(-) (limited to 'bpmn/so-bpmn-tasks/src/test/java/org/onap') diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasksTest.java index da8ea8f58c..07f03b592b 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasksTest.java @@ -88,16 +88,7 @@ public class SDNCUnassignTasksTest extends BaseTaskTest{ verify(sdncServiceInstanceResources, times(1)).unassignServiceInstance(serviceInstance, customer, requestContext); } - @Test - public void unassignServiceInstanceTest_inventoried() throws Exception { - doReturn("test").when(sdncServiceInstanceResources).unassignServiceInstance(serviceInstance, customer, requestContext); - - serviceInstance.setOrchestrationStatus(OrchestrationStatus.INVENTORIED); - - sdncUnassignTasks.unassignServiceInstance(execution); - - verify(sdncServiceInstanceResources, times(0)).unassignServiceInstance(serviceInstance, customer, requestContext); - } + @Test public void unassignServiceInstanceExceptionTest() throws Exception { @@ -118,26 +109,9 @@ public class SDNCUnassignTasksTest extends BaseTaskTest{ assertEquals("response", execution.getVariable("SDNCResponse")); } - @Test - public void unassignVfModuleTest_inventoried() throws Exception { - vfModule.setOrchestrationStatus(OrchestrationStatus.INVENTORIED); - - sdncUnassignTasks.unassignVfModule(execution); - verify(sdncVfModuleResources, times(0)).unassignVfModule(vfModule, genericVnf, serviceInstance); - assertNull(execution.getVariable("SDNCResponse")); - } - @Test - public void unassignVfModuleTest_pendingCreate() throws Exception { - vfModule.setOrchestrationStatus(OrchestrationStatus.PENDING_CREATE); - - sdncUnassignTasks.unassignVfModule(execution); - verify(sdncVfModuleResources, times(0)).unassignVfModule(vfModule, genericVnf, serviceInstance); - assertNull(execution.getVariable("SDNCResponse")); - } - @Test public void unassignVfModuleExceptionTest() throws Exception { expectedException.expect(BpmnError.class); @@ -157,25 +131,6 @@ public class SDNCUnassignTasksTest extends BaseTaskTest{ assertTrue(execution.getVariable("sdncUnassignVnfResponse").equals("response")); } - @Test - public void unassignVnfTest_inventoried() throws Exception { - genericVnf.setOrchestrationStatus(OrchestrationStatus.INVENTORIED); - - sdncUnassignTasks.unassignVnf(execution); - - verify(sdncVnfResources, times(0)).unassignVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext); - assertNull(execution.getVariable("sdncUnassignVnfResponse")); - } - - @Test - public void unassignVnfTest_created() throws Exception { - genericVnf.setOrchestrationStatus(OrchestrationStatus.CREATED); - - sdncUnassignTasks.unassignVnf(execution); - - verify(sdncVnfResources, times(0)).unassignVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext); - assertNull(execution.getVariable("sdncUnassignVnfResponse")); - } @Test public void unassignVnfExceptionTest() throws Exception { @@ -201,14 +156,4 @@ public class SDNCUnassignTasksTest extends BaseTaskTest{ assertEquals("response", execution.getVariable("SDNCUnAssignNetworkResponse")); assertEquals(cloudRegionSdnc, cloudRegion.getLcpCloudRegionId()); } - - @Test - public void unassignNetworkTest_inventoried() throws Exception { - network.setOrchestrationStatus(OrchestrationStatus.INVENTORIED); - - sdncUnassignTasks.unassignNetwork(execution); - - verify(sdncNetworkResources, times(0)).unassignNetwork(network, serviceInstance, customer, requestContext, cloudRegion); - assertNull(execution.getVariable("SDNCUnAssignNetworkResponse")); - } } -- cgit 1.2.3-korg