use of io.spine.test.procman.command.PmDeleteProcess in project core-java by SpineEventEngine.
the class ProcessManagerRepositoryShould method dispatch_command_to_archived_process_manager.
@Test
public void dispatch_command_to_archived_process_manager() throws InvocationTargetException {
final PmDeleteProcess deleteProcess = deleteProcess();
testDispatchCommand(deleteProcess);
final ProjectId projectId = deleteProcess.getProjectId();
TestProcessManager processManager = repository().findOrCreate(projectId);
assertTrue(processManager.isDeleted());
// Dispatch a command to the deleted process manager.
testDispatchCommand(addTask());
processManager = repository().findOrCreate(projectId);
final List<Task> addedTasks = processManager.getState().getTaskList();
assertFalse(addedTasks.isEmpty());
// Check that the process manager was not re-created before dispatching.
assertTrue(processManager.isDeleted());
}
use of io.spine.test.procman.command.PmDeleteProcess in project core-java by SpineEventEngine.
the class ProcessManagerRepositoryShould method dispatch_event_to_deleted_process_manager.
@Test
public void dispatch_event_to_deleted_process_manager() throws InvocationTargetException {
final PmDeleteProcess deleteProcess = deleteProcess();
testDispatchCommand(deleteProcess);
final ProjectId projectId = deleteProcess.getProjectId();
TestProcessManager processManager = repository().findOrCreate(projectId);
assertTrue(processManager.isDeleted());
// Dispatch an event to the deleted process manager.
testDispatchEvent(taskAdded());
processManager = repository().findOrCreate(projectId);
final List<Task> addedTasks = processManager.getState().getTaskList();
assertFalse(addedTasks.isEmpty());
// Check that the process manager was not re-created before dispatching.
assertTrue(processManager.isDeleted());
}
Aggregations