Search in sources :

Example 1 with InvalidProjectName

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());
}
Also used : Response(io.spine.base.Response) Command(io.spine.base.Command) InvalidProjectName(io.spine.test.failure.InvalidProjectName) Failure(io.spine.base.Failure) Test(org.junit.Test)

Aggregations

Command (io.spine.base.Command)1 Failure (io.spine.base.Failure)1 Response (io.spine.base.Response)1 InvalidProjectName (io.spine.test.failure.InvalidProjectName)1 Test (org.junit.Test)1