Search in sources :

Example 1 with ImportEvents

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

the class AggregateShould method import_events.

@Test
public void import_events() {
    final String projectName = getClass().getSimpleName();
    final ProjectId id = aggregate.getId();
    final ImportEvents importCmd = ImportEvents.newBuilder().setProjectId(id).addEvent(event(projectCreated(id, projectName), 1)).addEvent(event(taskAdded(id), 2)).build();
    aggregate.dispatchCommands(command(importCmd));
    assertTrue(aggregate.isProjectCreatedEventApplied);
    assertTrue(aggregate.isTaskAddedEventApplied);
}
Also used : ImportEvents(io.spine.test.aggregate.command.ImportEvents) ProjectId(io.spine.test.aggregate.ProjectId) Test(org.junit.Test)

Aggregations

ProjectId (io.spine.test.aggregate.ProjectId)1 ImportEvents (io.spine.test.aggregate.command.ImportEvents)1 Test (org.junit.Test)1