use of io.spine.test.failure.InvalidProjectName in project core-java by SpineEventEngine.
the class SingleTenantCommandBusShould method propagate_failures_to_failure_bus.
@Test
public void propagate_failures_to_failure_bus() {
final FaultyHandler faultyHandler = new FaultyHandler(eventBus);
commandBus.register(faultyHandler);
final Command addTaskCommand = clearTenantId(addTask());
commandBus.post(addTaskCommand, StreamObservers.<Response>noOpObserver());
final InvalidProjectName failureThrowable = faultyHandler.getThrowable();
final Failure expectedFailure = failureThrowable.toFailure(addTaskCommand);
verify(failureBus).post(eq(expectedFailure), ArgumentMatchers.<StreamObserver<Response>>any());
}
Aggregations