use of io.spine.server.procman.given.ProcessManagerRepositoryTestEnv.TestProcessManager in project core-java by SpineEventEngine.
the class ProcessManagerRepositoryShould method dispatch_event_to_archived_process_manager.
@Test
public void dispatch_event_to_archived_process_manager() throws InvocationTargetException {
final PmArchiveProcess archiveProcess = archiveProcess();
testDispatchCommand(archiveProcess);
final ProjectId projectId = archiveProcess.getProjectId();
TestProcessManager processManager = repository().findOrCreate(projectId);
assertTrue(processManager.isArchived());
// Dispatch an event to the archived 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.isArchived());
}
Aggregations