use of io.spine.server.BoundedContext in project core-java by SpineEventEngine.
the class TenantRepositoryShould method setUp.
@Before
public void setUp() {
final BoundedContext bc = BoundedContext.newBuilder().build();
TenantRepository<?, ?> impl = new TenantRepositoryImpl();
impl.initStorage(bc.getStorageFactory());
repository = spy(impl);
}
use of io.spine.server.BoundedContext in project core-java by SpineEventEngine.
the class StandPostShould method projectionRepositoryDispatch.
private static BoundedContextAction projectionRepositoryDispatch() {
return new BoundedContextAction() {
@Override
public void perform(BoundedContext context) {
// Init repository
final ProjectionRepository repository = Given.projectionRepo();
repository.initStorage(storageFactory(context.isMultitenant()));
// Dispatch an update from projection repo
repository.dispatch(EventEnvelope.of(Given.validEvent()));
}
};
}
use of io.spine.server.BoundedContext in project core-java by SpineEventEngine.
the class StandShould method register_projection_repositories.
@Test
public void register_projection_repositories() {
final boolean multitenant = isMultitenant();
final BoundedContext boundedContext = BoundedContext.newBuilder().setMultitenant(multitenant).build();
final Stand stand = boundedContext.getStand();
checkTypesEmpty(stand);
final StandTestProjectionRepository standTestProjectionRepo = new StandTestProjectionRepository();
stand.registerTypeSupplier(standTestProjectionRepo);
checkHasExactlyOne(stand.getExposedTypes(), Project.getDescriptor());
final ImmutableSet<TypeUrl> knownAggregateTypes = stand.getExposedAggregateTypes();
// As we registered a projection repo, known aggregate types should be still empty.
assertTrue("For some reason an aggregate type was registered", knownAggregateTypes.isEmpty());
final StandTestProjectionRepository anotherTestProjectionRepo = new StandTestProjectionRepository();
stand.registerTypeSupplier(anotherTestProjectionRepo);
checkHasExactlyOne(stand.getExposedTypes(), Project.getDescriptor());
}
Aggregations