Search in sources :

Example 11 with BoundedContext

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

the class AggregateRootShould method pass_null_tolerance_test.

@Test
public void pass_null_tolerance_test() throws NoSuchMethodException {
    final Constructor<AnAggregateRoot> ctor = AnAggregateRoot.class.getDeclaredConstructor(BoundedContext.class, String.class);
    new NullPointerTester().setDefault(Constructor.class, ctor).setDefault(BoundedContext.class, boundedContext).testStaticMethods(AggregateRoot.class, NullPointerTester.Visibility.PACKAGE);
}
Also used : BoundedContext(io.spine.server.BoundedContext) NullPointerTester(com.google.common.testing.NullPointerTester) Test(org.junit.Test)

Example 12 with BoundedContext

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

the class AggregateCommandEndpointShould method setUp.

@Before
public void setUp() {
    projectId = ProjectId.newBuilder().setId(Identifiers.newUuid()).build();
    final CommandStore commandStore = mock(CommandStore.class);
    final CommandBus.Builder commandBus = CommandBus.newBuilder().setMultitenant(true).setCommandStore(commandStore);
    final BoundedContext boundedContext = newBoundedContext(commandBus);
    subscriber = new Subscriber();
    boundedContext.getEventBus().register(subscriber);
    repository = new ProjectAggregateRepository(boundedContext);
    repositorySpy = spy(repository);
}
Also used : EventSubscriber(io.spine.server.event.EventSubscriber) CommandStore(io.spine.server.commandstore.CommandStore) MultiTenant.newBoundedContext(io.spine.testdata.TestBoundedContextFactory.MultiTenant.newBoundedContext) BoundedContext(io.spine.server.BoundedContext) CommandBus(io.spine.server.commandbus.CommandBus) Before(org.junit.Before)

Example 13 with BoundedContext

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

the class AggregatePartShould method createNullPointerTester.

private NullPointerTester createNullPointerTester() throws NoSuchMethodException {
    final Constructor constructor = AnAggregateRoot.class.getDeclaredConstructor(BoundedContext.class, String.class);
    final NullPointerTester tester = new NullPointerTester();
    tester.setDefault(Constructor.class, constructor).setDefault(BoundedContext.class, boundedContext).setDefault(AggregateRoot.class, root);
    return tester;
}
Also used : AggregatePart.getConstructor(io.spine.server.aggregate.AggregatePart.getConstructor) Constructor(java.lang.reflect.Constructor) BoundedContext(io.spine.server.BoundedContext) NullPointerTester(com.google.common.testing.NullPointerTester)

Example 14 with BoundedContext

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

the class AggregateRepositoryShould method setUp.

@Before
public void setUp() {
    final BoundedContext boundedContext = BoundedContext.newBuilder().build();
    repository = new ProjectAggregateRepository(boundedContext);
    repositorySpy = spy(repository);
}
Also used : BoundedContext(io.spine.server.BoundedContext) Before(org.junit.Before)

Example 15 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();
    repository = new TestRepository(bc);
    bc.register(repository);
}
Also used : BoundedContext(io.spine.server.BoundedContext) Before(org.junit.Before)

Aggregations

BoundedContext (io.spine.server.BoundedContext)26 Test (org.junit.Test)16 Before (org.junit.Before)5 TenantAwareTest (io.spine.server.tenant.TenantAwareTest)4 StreamObserver (io.grpc.stub.StreamObserver)3 MemoizingObserver (io.spine.io.StreamObservers.MemoizingObserver)3 StreamObservers.memoizingObserver (io.spine.io.StreamObservers.memoizingObserver)3 StreamObservers.noOpObserver (io.spine.io.StreamObservers.noOpObserver)3 StandTestProjectionRepository (io.spine.server.stand.Given.StandTestProjectionRepository)3 NullPointerTester (com.google.common.testing.NullPointerTester)2 Any (com.google.protobuf.Any)2 Version (io.spine.base.Version)2 CommandEnvelope (io.spine.envelope.CommandEnvelope)2 CommandBus (io.spine.server.commandbus.CommandBus)2 EventStore (io.spine.server.event.EventStore)2 ProjectionRepository (io.spine.server.projection.ProjectionRepository)2 ProjectId (io.spine.test.projection.ProjectId)2 MultiTenant.newBoundedContext (io.spine.testdata.TestBoundedContextFactory.MultiTenant.newBoundedContext)2 TypeUrl (io.spine.type.TypeUrl)2 Executor (java.util.concurrent.Executor)2