use of io.spine.server.integration.given.IntegrationBusTestEnv.ProjectRejectionsExtSubscriber 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());
}
Aggregations