### Question:
ManualHandlingTasks { public void completeTask(DelegateTask task) { DelegateExecution execution = task.getExecution(); try { String taskId = task.getId(); logger.debug("taskId is: " + taskId); TaskService taskService = execution.getProcessEngineServices().getTaskService(); Map<String, Object> taskVariables = taskService.getVariables(taskId); String responseValue = (String) taskVariables.get(RESPONSE_VALUE); logger.debug("Received responseValue on completion: " + responseValue); String responseValueUppercaseStart = responseValue.substring(0, 1).toUpperCase() + responseValue.substring(1); logger.debug("ResponseValue to taskListener: " + responseValueUppercaseStart); execution.setVariable(RESPONSE_VALUE_TASK, responseValueUppercaseStart); } catch (BpmnError e) { logger.debug(BPMN_EXCEPTION + e.getMessage()); throw e; } catch (Exception ex) { String msg = "Exception in completeManualTask " + ex.getMessage(); logger.debug(msg); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg); } }  void initRainyDayManualHandling(BuildingBlockExecution execution); void setFalloutTaskVariables(DelegateTask task); void setPauseTaskVariables(DelegateTask task); void completeTask(DelegateTask task); void createExternalTicket(BuildingBlockExecution execution); void updateRequestDbStatus(BuildingBlockExecution execution, String status); static final String VNF_TYPE; static final String DESCRIPTION; static final String SERVICE_TYPE; static final String MSO_REQUEST_ID; static final String REQUESTOR_ID; static final String ERROR_CODE; static final String VALID_RESPONSES; static final String TASK_TIMEOUT; static final String RESPONSE_VALUE_TASK; static final String RESPONSE_VALUE; static final String TASK_VARIABLE_TYPE; static final String TASK_VARIABLE_NFROLE; static final String TASK_VARIABLE_SUBSCRIPTION_SERVICE_TYPE; static final String TASK_VARIABLE_ORIGINAL_REQUEST_ID; static final String TASK_VARIABLE_ORIGINAL_REQUESTOR_ID; static final String TASK_VARIABLE_ERROR_SOURCE; static final String TASK_VARIABLE_ERROR_CODE; static final String TASK_VARIABLE_ERROR_MESSAGE; static final String TASK_VARIABLE_BUILDING_BLOCK_NAME; static final String TASK_VARIABLE_BUILDING_BLOCK_STEP; static final String TASK_VARIABLE_DESCRIPTION; static final String TASK_VARIABLE_TIMEOUT; static final String TASK_VARIABLE_VALID_RESPONSES; static final String BPMN_EXCEPTION; static final String RAINY_DAY_SERVICE_TYPE; static final String RAINY_DAY_VNF_TYPE; static final String RAINY_DAY_VNF_NAME; static final String G_BUILDING_BLOCK_EXECUTION; static final String WORKFLOW_EXCEPTION; }### Answer:
@Test public void completeTask_Test() throws Exception { when(task.getId()).thenReturn("taskId"); when(task.getExecution()).thenReturn(mockExecution); Map<String, Object> taskVariables = new HashMap<String, Object>(); taskVariables.put("responseValue", "resume"); when(mockExecution.getProcessEngineServices()).thenReturn(processEngineServices); when(processEngineServices.getTaskService()).thenReturn(taskService); when(taskService.getVariables(any(String.class))).thenReturn(taskVariables); manualHandlingTasks.completeTask(task); verify(mockExecution, times(1)).setVariable("responseValueTask", "Resume"); }