@Test
public void testSignal()
{

    // Create variables required for testing.
    final String processInstanceId = ACTIVITI_ID;
    final String signalTaskId = ACTIVITI_ID_2;
    final String executionId = ACTIVITI_ID_3;
    // Mock dependencies.
    ExecutionQuery executionQuery = mock(ExecutionQuery.class);
    Execution execution = mock(Execution.class);
    when(runtimeService.createExecutionQuery()).thenReturn(executionQuery);
    when(executionQuery.processInstanceId(processInstanceId)).thenReturn(executionQuery);
    when(executionQuery.activityId(signalTaskId)).thenReturn(executionQuery);
    when(executionQuery.singleResult()).thenReturn(execution);
    when(execution.getId()).thenReturn(executionId);
    // Call the method under test.
    activitiRuntimeHelper.signal(processInstanceId, signalTaskId);
    // Verify the calls.
    verify(runtimeService).createExecutionQuery();
    verify(executionQuery).processInstanceId(processInstanceId);
    verify(executionQuery).activityId(signalTaskId);
    verify(executionQuery).singleResult();
    verify(execution).getId();
    verify(runtimeService).signal(executionId);
    verifyNoMoreInteractions(executionQuery, execution, runtimeService);
}