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());
}
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;
}
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);
}
Aggregations