use of io.spine.server.command.given.CommandHandlerMethodTestEnv.ValidHandlerOneParamReturnsList in project core-java by SpineEventEngine.
the class CommandHandlerMethodShould method invoke_handler_method_and_return_message_list.
@Test
public void invoke_handler_method_and_return_message_list() {
final ValidHandlerOneParamReturnsList handlerObject = spy(new ValidHandlerOneParamReturnsList());
final CommandHandlerMethod handler = from(handlerObject.getHandler());
final RefCreateProject cmd = createProject();
final List<? extends Message> events = handler.invoke(handlerObject, cmd, emptyContext);
verify(handlerObject, times(1)).handleTest(cmd);
assertEquals(1, events.size());
final RefProjectCreated event = (RefProjectCreated) events.get(0);
assertEquals(cmd.getProjectId(), event.getProjectId());
}
use of io.spine.server.command.given.CommandHandlerMethodTestEnv.ValidHandlerOneParamReturnsList in project core-java by SpineEventEngine.
the class CommandHandlerMethodShould method consider_handler_with_one_msg_param_which_returns_list_valid.
@Test
public void consider_handler_with_one_msg_param_which_returns_list_valid() {
final Method handler = new ValidHandlerOneParamReturnsList().getHandler();
assertIsCommandHandler(handler, true);
}
Aggregations