Search in sources :

Example 1 with CommandHandler

use of io.spine.server.command.CommandHandler in project core-java by SpineEventEngine.

the class MultiTenantCommandBusShould method unregister_command_handler.

@Test
public void unregister_command_handler() {
    final CommandHandler handler = newCommandHandler();
    commandBus.register(handler);
    commandBus.unregister(handler);
    commandBus.post(createProject(), responseObserver);
    assertTrue(responseObserver.isError());
}
Also used : CommandHandler(io.spine.server.command.CommandHandler) Test(org.junit.Test)

Example 2 with CommandHandler

use of io.spine.server.command.CommandHandler in project core-java by SpineEventEngine.

the class CommandStoreShould method givenThrowingHandler.

private <E extends Throwable> Command givenThrowingHandler(E throwable) {
    final CommandHandler handler = new ThrowingCreateProjectHandler(throwable);
    commandBus.register(handler);
    final CreateProject msg = createProjectMessage();
    final Command command = requestFactory.command().create(msg);
    return command;
}
Also used : Command(io.spine.base.Command) CommandHandler(io.spine.server.command.CommandHandler) CreateProject(io.spine.test.command.CreateProject)

Example 3 with CommandHandler

use of io.spine.server.command.CommandHandler in project core-java by SpineEventEngine.

the class CommandDispatcherRegistryShould method unregister_handler.

@Test
public void unregister_handler() {
    final CommandHandler handler = new CreateProjectHandler(newUuid());
    registry.register(handler);
    registry.unregister(handler);
    assertNotSupported(CreateProject.class);
}
Also used : CommandHandler(io.spine.server.command.CommandHandler) Test(org.junit.Test)

Aggregations

CommandHandler (io.spine.server.command.CommandHandler)3 Test (org.junit.Test)2 Command (io.spine.base.Command)1 CreateProject (io.spine.test.command.CreateProject)1