use of io.spine.server.BoundedContext in project core-java by SpineEventEngine.
the class BoundedContextShould method set_storage_factory_for_EventBus.
@Test
public void set_storage_factory_for_EventBus() {
final BoundedContext bc = BoundedContext.newBuilder().setEventBus(EventBus.newBuilder()).build();
assertNotNull(bc.getEventBus());
}
use of io.spine.server.BoundedContext in project core-java by SpineEventEngine.
the class BoundedContextShould method do_not_set_storage_factory_if_EventStore_is_set.
@Test
public void do_not_set_storage_factory_if_EventStore_is_set() {
final EventStore eventStore = mock(EventStore.class);
final BoundedContext bc = BoundedContext.newBuilder().setEventBus(EventBus.newBuilder().setEventStore(eventStore)).build();
assertEquals(eventStore, bc.getEventBus().getEventStore());
}
use of io.spine.server.BoundedContext in project core-java by SpineEventEngine.
the class BoundedContextShould method set_same_multitenancy_in_Stand.
@Test
public void set_same_multitenancy_in_Stand() {
BoundedContext bc = BoundedContext.newBuilder().setMultitenant(true).build();
assertEquals(bc.isMultitenant(), bc.getStand().isMultitenant());
bc = BoundedContext.newBuilder().setMultitenant(false).build();
assertEquals(bc.isMultitenant(), bc.getStand().isMultitenant());
}
use of io.spine.server.BoundedContext in project core-java by SpineEventEngine.
the class EventBusBuilderShould method setUp.
@Before
public void setUp() {
final BoundedContext bc = BoundedContext.newBuilder().setMultitenant(true).build();
this.storageFactory = bc.getStorageFactory();
}
use of io.spine.server.BoundedContext in project core-java by SpineEventEngine.
the class IntegrationBusShould method dispatch_events_from_one_BC_to_entities_with_ext_subscribers_of_multiple_BCs.
@Test
public void dispatch_events_from_one_BC_to_entities_with_ext_subscribers_of_multiple_BCs() {
final InMemoryTransportFactory transportFactory = InMemoryTransportFactory.newInstance();
final Set<BoundedContextName> destinationNames = newHashSet();
final BoundedContext sourceContext = contextWithTransport(transportFactory);
for (int i = 0; i < 42; i++) {
final BoundedContext destinationCtx = contextWithContextAwareEntitySubscriber(transportFactory);
final BoundedContextName name = destinationCtx.getName();
destinationNames.add(name);
}
assertTrue(ContextAwareProjectDetails.getExternalContexts().isEmpty());
final Event event = projectCreated();
sourceContext.getEventBus().post(event);
assertEquals(destinationNames.size(), ContextAwareProjectDetails.getExternalContexts().size());
assertEquals(destinationNames.size(), ContextAwareProjectDetails.getExternalEvents().size());
}
Aggregations