use of io.spine.test.procman.ProjectId 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());
}
use of io.spine.test.procman.ProjectId in project core-java by SpineEventEngine.
the class PmMessageDeliveryTestEnv method createProject.
public static Command createProject() {
final ProjectId projectId = projectId();
final Command command = createCommand(PmCreateProject.newBuilder().setProjectId(projectId).build());
return command;
}
use of io.spine.test.procman.ProjectId in project core-java by SpineEventEngine.
the class PmMessageDeliveryTestEnv method projectStarted.
public static Event projectStarted() {
final ProjectId projectId = projectId();
final TestEventFactory eventFactory = TestEventFactory.newInstance(AnyPacker.pack(projectId), PmMessageDeliveryTestEnv.class);
final PmProjectStarted msg = PmProjectStarted.newBuilder().setProjectId(projectId).build();
final Event result = eventFactory.createEvent(msg);
return result;
}
use of io.spine.test.procman.ProjectId in project core-java by SpineEventEngine.
the class PmMessageDeliveryTestEnv method cannotStartProject.
public static Rejection cannotStartProject() {
final ProjectId projectId = projectId();
final PmStartProject cmdMessage = PmStartProject.newBuilder().setProjectId(projectId).build();
final Command command = createCommand(cmdMessage);
final Rejection result = toRejection(throwableWith(projectId), command);
return result;
}
Aggregations