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