use of io.spine.test.aggregate.command.AddTask 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;
}
use of io.spine.test.aggregate.command.AddTask in project core-java by SpineEventEngine.
the class AggregatePartShould method prepareAggregatePart.
private void prepareAggregatePart() {
final AddTask addTask = ((AddTask.Builder) Sample.builderForType(AddTask.class)).setProjectId(ProjectId.newBuilder().setId("agg-part-ID")).build();
dispatch(taskPart, env(addTask));
}
Aggregations