use of io.spine.server.command.given.CommandHandlerMethodTestEnv.RejectingAggregate in project core-java by SpineEventEngine.
the class CommandHandlerMethodShould method set_producer_ID_if_entity.
@Test
public void set_producer_ID_if_entity() {
final RefCreateProject commandMessage = createProject();
final Aggregate<ProjectId, ?, ?> entity = new RejectingAggregate(commandMessage.getProjectId());
final CommandEnvelope cmd = requestFactory.createEnvelope(commandMessage);
try {
AggregateMessageDispatcher.dispatchCommand(entity, cmd);
} catch (HandlerMethodFailedException e) {
assertCauseAndId(e, entity.getId());
}
}
Aggregations