use of io.zeebe.broker.system.ConfigurationManager in project zeebe by zeebe-io.
the class BrokerTest method shouldCreateBrokerWithConfigurationManager.
/**
* This tests the constructor that takes a {@link ConfigurationManager} instance.
* This is used in the Spring integration.
*/
@Test
public void shouldCreateBrokerWithConfigurationManager() {
final InputStream configStream = BrokerTest.class.getClassLoader().getResourceAsStream("zeebe.unit-test.cfg.toml");
final ConfigurationManager configurationManager = new ConfigurationManagerImpl(configStream);
// when
broker = new Broker(configurationManager);
// then I can register a dependency to a broker service successfully
final ActorFuture<Void> future = broker.getBrokerContext().getServiceContainer().createService(ServiceName.newServiceName("foo", Object.class), new Service<Object>() {
@Override
public void start(ServiceStartContext startContext) {
}
@Override
public void stop(ServiceStopContext stopContext) {
}
@Override
public Object get() {
return null;
}
}).dependency(ClusterServiceNames.CLUSTER_MANAGER_SERVICE).install();
waitUntil(future::isDone);
assertThat(future).isDone();
}
Aggregations