use of io.spine.server.tenant.TenantIndex in project core-java by SpineEventEngine.
the class AbstractCommandBusTestSuite method setUp.
@Before
public void setUp() {
final InMemoryStorageFactory storageFactory = InMemoryStorageFactory.getInstance(this.multitenant);
final TenantIndex tenantIndex = TenantAwareTest.createTenantIndex(this.multitenant, storageFactory);
commandStore = spy(new CommandStore(storageFactory, tenantIndex));
scheduler = spy(new ExecutorCommandScheduler());
log = spy(new Log());
failureBus = spy(FailureBus.newBuilder().build());
commandBus = CommandBus.newBuilder().setMultitenant(this.multitenant).setCommandStore(commandStore).setCommandScheduler(scheduler).setFailureBus(failureBus).setThreadSpawnAllowed(false).setLog(log).setAutoReschedule(false).build();
eventBus = EventBus.newBuilder().setStorageFactory(storageFactory).build();
requestFactory = this.multitenant ? TestActorRequestFactory.newInstance(getClass(), newTenantUuid()) : TestActorRequestFactory.newInstance(getClass());
createProjectHandler = new CreateProjectHandler();
responseObserver = new TestResponseObserver();
}
use of io.spine.server.tenant.TenantIndex in project core-java by SpineEventEngine.
the class BoundedContextBuilderShould method allow_TenantIndex_configuration.
@Test
public void allow_TenantIndex_configuration() {
final TenantIndex tenantIndex = mock(TenantIndex.class);
assertEquals(tenantIndex, BoundedContext.newBuilder().setTenantIndex(tenantIndex).getTenantIndex().get());
}
use of io.spine.server.tenant.TenantIndex in project core-java by SpineEventEngine.
the class ProcessManagerShould method setUp.
@Before
public void setUp() {
final StorageFactory storageFactory = StorageFactorySwitch.get(true);
final TenantIndex tenantIndex = TenantAwareTest.createTenantIndex(false, storageFactory);
final CommandStore commandStore = spy(new CommandStore(storageFactory, tenantIndex));
commandBus = spy(CommandBus.newBuilder().setCommandStore(commandStore).build());
processManager = Given.processManagerOfClass(TestProcessManager.class).withId(ID).withVersion(2).withState(Any.getDefaultInstance()).build();
}
use of io.spine.server.tenant.TenantIndex in project core-java by SpineEventEngine.
the class CommandBusBuilderShould method setUp.
@Before
public void setUp() {
final boolean multitenant = true;
final InMemoryStorageFactory storageFactory = InMemoryStorageFactory.getInstance(multitenant);
final TenantIndex tenantIndex = TenantAwareTest.createTenantIndex(multitenant, storageFactory);
commandStore = new CommandStore(storageFactory, tenantIndex);
}
Aggregations