use of io.spine.server.rejection.RejectionBus in project core-java by SpineEventEngine.
the class IntegrationBusBuilderShould method return_previously_set_RejectionBus.
@Test
public void return_previously_set_RejectionBus() {
final RejectionBus mock = mock(RejectionBus.class);
assertEquals(mock, builder().setRejectionBus(mock).getRejectionBus().get());
}
use of io.spine.server.rejection.RejectionBus in project core-java by SpineEventEngine.
the class IntegrationBusShould method not_dispatch_rejections_to_domestic_subscribers_if_they_requested_external.
@Test
public void not_dispatch_rejections_to_domestic_subscribers_if_they_requested_external() {
final InMemoryTransportFactory transportFactory = InMemoryTransportFactory.newInstance();
final BoundedContext sourceContext = contextWithExtEntitySubscribers(transportFactory);
final ProjectRejectionsExtSubscriber standaloneSubscriber = new ProjectRejectionsExtSubscriber();
final RejectionBus rejectionBus = sourceContext.getRejectionBus();
rejectionBus.register(standaloneSubscriber);
assertNull(ProjectRejectionsExtSubscriber.getExternalRejection());
assertNull(ProjectWizard.getExternalRejection());
assertNull(ProjectCountAggregate.getExternalRejection());
final Rejection rejection = cannotStartArchivedProject();
rejectionBus.post(rejection);
assertNull(ProjectRejectionsExtSubscriber.getExternalRejection());
assertNull(ProjectWizard.getExternalRejection());
assertNull(ProjectCountAggregate.getExternalRejection());
}
use of io.spine.server.rejection.RejectionBus in project core-java by SpineEventEngine.
the class MultiTenantCommandBusShould method allow_to_specify_rejection_bus_via_builder.
@Test
public void allow_to_specify_rejection_bus_via_builder() {
final RejectionBus expectedRejectionBus = mock(RejectionBus.class);
final CommandBus commandBus = CommandBus.newBuilder().setCommandStore(commandStore).setRejectionBus(expectedRejectionBus).build();
assertNotNull(commandBus);
final RejectionBus actualRejectionBus = commandBus.rejectionBus();
assertEquals(expectedRejectionBus, actualRejectionBus);
}
use of io.spine.server.rejection.RejectionBus in project core-java by SpineEventEngine.
the class CommandBusBuilderShould method allow_to_specify_rejeciton_bus.
@Test
public void allow_to_specify_rejeciton_bus() {
final RejectionBus expectedRejectionBus = mock(RejectionBus.class);
final CommandBus.Builder builder = builder().setCommandStore(commandStore).setRejectionBus(expectedRejectionBus);
assertEquals(expectedRejectionBus, builder.getRejectionBus().get());
}
Aggregations