Search in sources :

Example 1 with AggProjectCreated

use of io.spine.test.aggregate.event.AggProjectCreated in project core-java by SpineEventEngine.

the class AggregateCommandEndpointShould method post_events_on_command_dispatching.

@Test
public void post_events_on_command_dispatching() {
    final CommandEnvelope cmd = CommandEnvelope.of(createProject(projectId));
    repository.dispatch(cmd);
    final AggProjectCreated msg = subscriber.remembered;
    assertEquals(projectId, msg.getProjectId());
}
Also used : CommandEnvelope(io.spine.core.CommandEnvelope) AggProjectCreated(io.spine.test.aggregate.event.AggProjectCreated) Test(org.junit.Test)

Example 2 with AggProjectCreated

use of io.spine.test.aggregate.event.AggProjectCreated in project core-java by SpineEventEngine.

the class TestAggregate method handle.

@Assign
AggProjectCreated handle(AggCreateProject cmd, CommandContext ctx) {
    isCreateProjectCommandHandled = true;
    final AggProjectCreated event = projectCreated(cmd.getProjectId(), cmd.getName());
    return event;
}
Also used : AggProjectCreated(io.spine.test.aggregate.event.AggProjectCreated) Assign(io.spine.server.command.Assign)

Aggregations

AggProjectCreated (io.spine.test.aggregate.event.AggProjectCreated)2 CommandEnvelope (io.spine.core.CommandEnvelope)1 Assign (io.spine.server.command.Assign)1 Test (org.junit.Test)1