use of io.zeebe.broker.system.ConfigurationManagerImpl in project zeebe by zeebe-io.
the class ConfigurationRule method starting.
@Override
protected void starting(final Description description) {
super.starting(description);
final ConfigurationFile annotation = description.getAnnotation(ConfigurationFile.class);
if (annotation != null) {
final String fileName = annotation.value();
final InputStream configurationStream = description.getTestClass().getClassLoader().getResourceAsStream(fileName);
configurationManager = new ConfigurationManagerImpl(configurationStream);
}
}
use of io.zeebe.broker.system.ConfigurationManagerImpl in project zeebe by zeebe-io.
the class ConfigurationDirectoryTest method before.
@Before
public void before() {
final String configuration = scenario.getConfiguration();
final InputStream is = ConfigurationDirectoryTest.class.getClassLoader().getResourceAsStream(configuration);
configurationManager = new ConfigurationManagerImpl(is);
}
use of io.zeebe.broker.system.ConfigurationManagerImpl 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