Search in sources :

Example 1 with AddTask

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;
}
Also used : AddTask(io.spine.test.aggregate.command.AddTask) CreateProject(io.spine.test.aggregate.command.CreateProject) StartProject(io.spine.test.aggregate.command.StartProject)

Example 2 with AddTask

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));
}
Also used : AddTask(io.spine.test.aggregate.command.AddTask)

Aggregations

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