Search in sources :

Example 31 with BoundedContext

use of io.spine.server.BoundedContext in project core-java by SpineEventEngine.

the class BoundedContextBuilderShould method create_CommandBus_if_it_was_not_set.

@Test
public void create_CommandBus_if_it_was_not_set() {
    // Pass EventBus to builder initialization, and do NOT pass CommandBus.
    final BoundedContext boundedContext = builder.setEventBus(EventBus.newBuilder()).build();
    assertNotNull(boundedContext.getCommandBus());
}
Also used : BoundedContext(io.spine.server.BoundedContext) Test(org.junit.Test)

Example 32 with BoundedContext

use of io.spine.server.BoundedContext in project core-java by SpineEventEngine.

the class BoundedContextShould method tell_if_set_multitenant.

@Test
public void tell_if_set_multitenant() {
    final BoundedContext bc = BoundedContext.newBuilder().setMultitenant(true).build();
    assertTrue(bc.isMultitenant());
}
Also used : BoundedContext(io.spine.server.BoundedContext) Test(org.junit.Test)

Example 33 with BoundedContext

use of io.spine.server.BoundedContext in project core-java by SpineEventEngine.

the class BoundedContextShould method set_multi_tenancy_in_CommandBus.

@Test
public void set_multi_tenancy_in_CommandBus() {
    BoundedContext bc = BoundedContext.newBuilder().setMultitenant(true).build();
    assertEquals(bc.isMultitenant(), bc.getCommandBus().isMultitenant());
    bc = BoundedContext.newBuilder().setMultitenant(false).build();
    assertEquals(bc.isMultitenant(), bc.getCommandBus().isMultitenant());
}
Also used : BoundedContext(io.spine.server.BoundedContext) Test(org.junit.Test)

Example 34 with BoundedContext

use of io.spine.server.BoundedContext in project core-java by SpineEventEngine.

the class DefaultEntityStorageConverterShould method setUp.

@Before
public void setUp() {
    final BoundedContext bc = BoundedContext.newBuilder().build();
    RecordBasedRepository<Long, TestEntity, StringValue> repository = new TestRepository();
    bc.register(repository);
    final TypeUrl stateType = repository.entityClass().getStateType();
    converter = forAllFields(stateType, repository.entityFactory());
}
Also used : BoundedContext(io.spine.server.BoundedContext) TypeUrl(io.spine.type.TypeUrl) StringValue(com.google.protobuf.StringValue) Before(org.junit.Before)

Example 35 with BoundedContext

use of io.spine.server.BoundedContext in project core-java by SpineEventEngine.

the class AggregatePartClassShould method setUp.

@Before
public void setUp() {
    ModelTests.clearModel();
    final BoundedContext boundedContext = BoundedContext.newBuilder().build();
    root = new AnAggregateRoot(boundedContext, newUuid());
}
Also used : AnAggregateRoot(io.spine.server.aggregate.given.AggregatePartTestEnv.AnAggregateRoot) BoundedContext(io.spine.server.BoundedContext) Before(org.junit.Before)

Aggregations

BoundedContext (io.spine.server.BoundedContext)58 Test (org.junit.Test)34 Event (io.spine.core.Event)12 InMemoryTransportFactory (io.spine.server.integration.memory.InMemoryTransportFactory)12 Before (org.junit.Before)9 Rejection (io.spine.core.Rejection)6 Ack (io.spine.core.Ack)5 Message (com.google.protobuf.Message)4 Error (io.spine.base.Error)4 TypeUrl (io.spine.type.TypeUrl)4 Any (com.google.protobuf.Any)3 StringValue (com.google.protobuf.StringValue)3 Command (io.spine.core.Command)3 CommandEnvelope (io.spine.core.CommandEnvelope)3 TenantId (io.spine.core.TenantId)3 CustomerAggregateRepository (io.spine.server.Given.CustomerAggregateRepository)3 EventBus (io.spine.server.event.EventBus)3 StandTestProjectionRepository (io.spine.server.stand.Given.StandTestProjectionRepository)3 TenantAwareTest (io.spine.server.tenant.TenantAwareTest)3 NullPointerTester (com.google.common.testing.NullPointerTester)2