Search in sources :

Example 1 with StartProject

use of io.spine.test.aggregate.command.StartProject in project core-java by SpineEventEngine.

the class AggregateRepositoryShould method givenAggregateWithUncommittedEvents.

private static ProjectAggregate givenAggregateWithUncommittedEvents(ProjectId id) {
    final ProjectAggregate aggregate = Given.aggregateOfClass(ProjectAggregate.class).withId(id).build();
    final CreateProject createProject = ((CreateProject.Builder) Sample.builderForType(CreateProject.class)).setProjectId(id).build();
    final AddTask addTask = ((AddTask.Builder) Sample.builderForType(AddTask.class)).setProjectId(id).build();
    final StartProject startProject = ((StartProject.Builder) Sample.builderForType(StartProject.class)).setProjectId(id).build();
    dispatch(aggregate, env(createProject));
    dispatch(aggregate, env(addTask));
    dispatch(aggregate, env(startProject));
    return aggregate;
}
Also used : AddTask(io.spine.test.aggregate.command.AddTask) CreateProject(io.spine.test.aggregate.command.CreateProject) StartProject(io.spine.test.aggregate.command.StartProject)

Aggregations

AddTask (io.spine.test.aggregate.command.AddTask)1 CreateProject (io.spine.test.aggregate.command.CreateProject)1 StartProject (io.spine.test.aggregate.command.StartProject)1