### Question:
SDNCUnassignTasks extends AbstractSDNCTask { public void unassignServiceInstance(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); RequestContext requestContext = gBBInput.getRequestContext(); Customer customer = gBBInput.getCustomer(); GenericResourceApiServiceOperationInformation req = sdncSIResources.unassignServiceInstance(serviceInstance, customer, requestContext); SDNCRequest sdncRequest = new SDNCRequest(); sdncRequest.setSDNCPayload(req); sdncRequest.setTopology(SDNCTopology.SERVICE); execution.setVariable(SDNC_REQUEST, sdncRequest); } catch (Exception ex) { logger.error("Exception occurred in SDNCUnassignTasks unassignServiceInstance", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } }  void unassignServiceInstance(BuildingBlockExecution execution); void unassignVfModule(BuildingBlockExecution execution); void unassignVnf(BuildingBlockExecution execution); void unassignNetwork(BuildingBlockExecution execution); static final String SDNC_REQUEST; }### Answer:
@Test public void unassignServiceInstanceTest() throws Exception { doReturn(new GenericResourceApiServiceOperationInformation()).when(sdncServiceInstanceResources) .unassignServiceInstance(serviceInstance, customer, requestContext); sdncUnassignTasks.unassignServiceInstance(execution); verify(sdncServiceInstanceResources, times(1)).unassignServiceInstance(serviceInstance, customer, requestContext); SDNCRequest sdncRequest = execution.getVariable("SDNCRequest"); assertEquals(SDNCTopology.SERVICE, sdncRequest.getTopology()); }
@Test public void unassignServiceInstanceExceptionTest() throws Exception { expectedException.expect(BpmnError.class); doThrow(RuntimeException.class).when(sdncServiceInstanceResources).unassignServiceInstance(serviceInstance, customer, requestContext); sdncUnassignTasks.unassignServiceInstance(execution); }