use of io.spine.server.aggregate.given.AggregateCommandEndpointTestEnv.ProjectAggregate in project core-java by SpineEventEngine.
the class AggregateCommandEndpointShould method store_aggregate_on_command_dispatching.
@Test
public void store_aggregate_on_command_dispatching() {
final CommandEnvelope cmd = CommandEnvelope.of(createProject(projectId));
final AggCreateProject msg = (AggCreateProject) cmd.getMessage();
repository.dispatch(cmd);
final Optional<ProjectAggregate> optional = repository.find(projectId);
assertTrue(optional.isPresent());
final ProjectAggregate aggregate = optional.get();
assertEquals(projectId, aggregate.getId());
assertEquals(msg.getName(), aggregate.getState().getName());
}
Aggregations