use of com.orbitz.consul.model.session.SessionInfo in project exhibitor by soabase.
the class TestConsulConfigProvider method testBasic.
@Test
public void testBasic() throws Exception {
ConsulConfigProvider config = new ConsulConfigProvider(client, "prefix", new Properties());
try {
config.start();
config.loadConfig();
Properties properties = new Properties();
properties.setProperty(PropertyBasedInstanceConfig.toName(StringConfigs.ZOO_CFG_EXTRA, PropertyBasedInstanceConfig.ROOT_PROPERTY_PREFIX), "1,2,3");
config.storeConfig(new PropertyBasedInstanceConfig(properties, new Properties()), 0);
timing.sleepABit();
LoadedInstanceConfig instanceConfig = config.loadConfig();
Assert.assertEquals(instanceConfig.getConfig().getRootConfig().getString(StringConfigs.ZOO_CFG_EXTRA), "1,2,3");
List<SessionInfo> sessions = client.sessionClient().listSessions();
Assert.assertEquals(sessions.size(), 0, "Consul session still exists!");
} finally {
CloseableUtils.closeQuietly(config);
}
}
Aggregations