ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("signalSuspendedProcessInstance");
runtimeService.signalEventReceived(signal);
assertEquals(0, runtimeService.createProcessInstanceQuery().count());
// Now test when suspending the process instance: the process instance shouldn't be continued
ProcessDefinition processDefinition = repositoryService
.createProcessDefinitionQuery()
.processDefinitionKey("signalSuspendedProcessInstance")
.singleResult();
processInstance = runtimeService.startProcessInstanceByKey("signalSuspendedProcessInstance");
runtimeService.suspendProcessInstanceByProcessDefinitionKey(processDefinition.getKey());
runtimeService.signalEventReceived(signal);
assertEquals(1, runtimeService.createProcessInstanceQuery().count());
runtimeService.signalEventReceived(signal, new HashMap<String, Object>());
assertEquals(1, runtimeService.createProcessInstanceQuery().count());