Search in sources :

Example 1 with RejectingHandler

use of io.spine.server.command.given.CommandHandlerMethodTestEnv.RejectingHandler in project core-java by SpineEventEngine.

the class CommandHandlerMethodShould method set_producer_ID_if_command_handler.

@Test
public void set_producer_ID_if_command_handler() {
    final CommandHandler handler = new RejectingHandler();
    final CommandEnvelope envelope = requestFactory.createEnvelope(createProject());
    try {
        handler.dispatch(envelope);
    } catch (HandlerMethodFailedException e) {
        assertCauseAndId(e, handler.getId());
    }
}
Also used : HandlerMethodFailedException(io.spine.server.model.HandlerMethodFailedException) CommandEnvelope(io.spine.core.CommandEnvelope) RejectingHandler(io.spine.server.command.given.CommandHandlerMethodTestEnv.RejectingHandler) Test(org.junit.Test)

Aggregations

CommandEnvelope (io.spine.core.CommandEnvelope)1 RejectingHandler (io.spine.server.command.given.CommandHandlerMethodTestEnv.RejectingHandler)1 HandlerMethodFailedException (io.spine.server.model.HandlerMethodFailedException)1 Test (org.junit.Test)1