Search in sources :

Example 6 with ProjectAggregateRepository

use of io.spine.server.bc.given.BoundedContextTestEnv.ProjectAggregateRepository in project core-java by SpineEventEngine.

the class BoundedContextShould method assign_storage_during_registration_if_repository_does_not_have_storage.

@Test
public void assign_storage_during_registration_if_repository_does_not_have_storage() {
    final ProjectAggregateRepository repository = new ProjectAggregateRepository();
    boundedContext.register(repository);
    assertTrue(repository.isStorageAssigned());
}
Also used : AnotherProjectAggregateRepository(io.spine.server.bc.given.BoundedContextTestEnv.AnotherProjectAggregateRepository) ProjectAggregateRepository(io.spine.server.bc.given.BoundedContextTestEnv.ProjectAggregateRepository) Test(org.junit.Test)

Example 7 with ProjectAggregateRepository

use of io.spine.server.bc.given.BoundedContextTestEnv.ProjectAggregateRepository in project core-java by SpineEventEngine.

the class BoundedContextShould method propagate_registered_repositories_to_stand.

@Test
public void propagate_registered_repositories_to_stand() {
    final BoundedContext boundedContext = BoundedContext.newBuilder().build();
    final Stand stand = Spy.ofClass(Stand.class).on(boundedContext);
    verify(stand, never()).registerTypeSupplier(any(Repository.class));
    final ProjectAggregateRepository repository = new ProjectAggregateRepository();
    boundedContext.register(repository);
    verify(stand).registerTypeSupplier(eq(repository));
}
Also used : Stand(io.spine.server.stand.Stand) ProjectReportRepository(io.spine.server.bc.given.BoundedContextTestEnv.ProjectReportRepository) AnotherProjectAggregateRepository(io.spine.server.bc.given.BoundedContextTestEnv.AnotherProjectAggregateRepository) SecretProjectRepository(io.spine.server.bc.given.BoundedContextTestEnv.SecretProjectRepository) Repository(io.spine.server.entity.Repository) ProjectAggregateRepository(io.spine.server.bc.given.BoundedContextTestEnv.ProjectAggregateRepository) AnotherProjectAggregateRepository(io.spine.server.bc.given.BoundedContextTestEnv.AnotherProjectAggregateRepository) ProjectAggregateRepository(io.spine.server.bc.given.BoundedContextTestEnv.ProjectAggregateRepository) BoundedContext(io.spine.server.BoundedContext) Test(org.junit.Test)

Aggregations

AnotherProjectAggregateRepository (io.spine.server.bc.given.BoundedContextTestEnv.AnotherProjectAggregateRepository)7 ProjectAggregateRepository (io.spine.server.bc.given.BoundedContextTestEnv.ProjectAggregateRepository)7 Test (org.junit.Test)6 ProjectReportRepository (io.spine.server.bc.given.BoundedContextTestEnv.ProjectReportRepository)2 SecretProjectRepository (io.spine.server.bc.given.BoundedContextTestEnv.SecretProjectRepository)2 Repository (io.spine.server.entity.Repository)2 Maps.newConcurrentMap (com.google.common.collect.Maps.newConcurrentMap)1 BoundedContext (io.spine.server.BoundedContext)1 Stand (io.spine.server.stand.Stand)1 StorageFactory (io.spine.server.storage.StorageFactory)1 Map (java.util.Map)1