Search in sources :

Example 1 with PrjProjectDeleted

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());
}
Also used : Task(io.spine.test.projection.Task) PrjProjectDeleted(io.spine.test.projection.event.PrjProjectDeleted) ProjectId(io.spine.test.projection.ProjectId) TestProjection(io.spine.server.projection.given.ProjectionRepositoryTestEnv.TestProjection) Test(org.junit.Test)

Aggregations

TestProjection (io.spine.server.projection.given.ProjectionRepositoryTestEnv.TestProjection)1 ProjectId (io.spine.test.projection.ProjectId)1 Task (io.spine.test.projection.Task)1 PrjProjectDeleted (io.spine.test.projection.event.PrjProjectDeleted)1 Test (org.junit.Test)1