use of io.spine.test.projection.event.PrjProjectArchived in project core-java by SpineEventEngine.
the class ProjectionRepositoryShould method dispatch_event_to_archived_projection.
@Test
public void dispatch_event_to_archived_projection() {
final PrjProjectArchived projectArchived = GivenEventMessage.projectArchived();
checkDispatchesEvent(projectArchived);
final ProjectId projectId = projectArchived.getProjectId();
TestProjection projection = repository().findOrCreate(projectId);
assertTrue(projection.isArchived());
// Dispatch an event to the archived projection.
checkDispatchesEvent(GivenEventMessage.taskAdded());
projection = repository().findOrCreate(projectId);
final List<Task> addedTasks = projection.getState().getTaskList();
assertFalse(addedTasks.isEmpty());
// Check that the projection was not re-created before dispatching.
assertTrue(projection.isArchived());
}
Aggregations