### Question:
SDNCAssignTasks extends AbstractSDNCTask { public void assignServiceInstance(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); RequestContext requestContext = gBBInput.getRequestContext(); ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); Customer customer = gBBInput.getCustomer(); GenericResourceApiServiceOperationInformation req = sdncSIResources.assignServiceInstance(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", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } }  void assignServiceInstance(BuildingBlockExecution execution); void assignVnf(BuildingBlockExecution execution); void assignVfModule(BuildingBlockExecution execution); void assignNetwork(BuildingBlockExecution execution); static final String SDNC_REQUEST; }### Answer:
@Test public void assignServiceInstanceTest() throws Exception { doReturn(new GenericResourceApiServiceOperationInformation()).when(sdncServiceInstanceResources) .assignServiceInstance(serviceInstance, customer, requestContext); sdncAssignTasks.assignServiceInstance(execution); verify(sdncServiceInstanceResources, times(1)).assignServiceInstance(serviceInstance, customer, requestContext); SDNCRequest sdncRequest = execution.getVariable("SDNCRequest"); assertEquals(SDNCTopology.SERVICE, sdncRequest.getTopology()); }
@Test public void assignServiceInstanceExceptionTest() throws Exception { expectedException.expect(BpmnError.class); doThrow(RuntimeException.class).when(sdncServiceInstanceResources).assignServiceInstance(serviceInstance, customer, requestContext); sdncAssignTasks.assignServiceInstance(execution); }