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;
}
Aggregations