@Test
public void testSetTaskSuccessInWorkflow()
{

    // Create variables required for testing.
    final String currentActivityId = ACTIVITI_ID;
    final String executionId = ACTIVITI_ID_2;
    final String statusTaskWorkflowVariableName =
        activitiRuntimeHelper.buildTaskWorkflowVariableName(currentActivityId, ActivitiRuntimeHelper.VARIABLE_STATUS);
    // Mock dependencies.
    DelegateExecution execution = mock(DelegateExecution.class);
    when(execution.getCurrentActivityId()).thenReturn(currentActivityId);
    when(execution.getId()).thenReturn(executionId);
    // Call the method under test.
    activitiRuntimeHelper.setTaskSuccessInWorkflow(execution);
    // Verify the calls.
    verify(execution).getCurrentActivityId();
    verify(execution).getId();
    verify(runtimeService).getVariables(executionId);
    verify(runtimeService).setVariable(executionId, statusTaskWorkflowVariableName, ActivitiRuntimeHelper.TASK_STATUS_SUCCESS);
    verifyNoMoreInteractions(execution, runtimeService);
}