use of io.fabric8.api.ZooKeeperClusterBootstrap in project fabric8 by jboss-fuse.
the class BootstrapServiceTest method testZooKeeperClusterBootstrapAvailable.
@Test
public void testZooKeeperClusterBootstrapAvailable() throws Exception {
ZooKeeperClusterBootstrap bootstrap = ServiceLocator.getRequiredService(ZooKeeperClusterBootstrap.class);
Assert.assertNotNull("ZooKeeperClusterBootstrap not null", bootstrap);
}
use of io.fabric8.api.ZooKeeperClusterBootstrap in project fabric8 by jboss-fuse.
the class ContainerStartupTest method testLocalFabricCluster.
@Test
public void testLocalFabricCluster() throws Exception {
Builder<?> builder = CreateEnsembleOptions.builder().agentEnabled(false).clean(true).zookeeperPassword(ADMIN_PASSWORD).waitForProvision(false);
CreateEnsembleOptions options = builder.build();
ZooKeeperClusterBootstrap bootstrap = ServiceLocator.getRequiredService(ZooKeeperClusterBootstrap.class);
bootstrap.create(options);
FabricService fabricService = ServiceLocator.getRequiredService(FabricService.class);
Container[] containers = fabricService.getContainers();
Assert.assertNotNull("Containers not null", containers);
// Test that a provided default password exists
ConfigurationAdmin configurationAdmin = ServiceLocator.getRequiredService(ConfigurationAdmin.class);
org.osgi.service.cm.Configuration configuration = configurationAdmin.getConfiguration(io.fabric8.api.Constants.ZOOKEEPER_CLIENT_PID);
Dictionary<String, Object> dictionary = configuration.getProperties();
Assert.assertEquals("Expected provided zookeeper password", PasswordEncoder.encode(ADMIN_PASSWORD), dictionary.get("zookeeper.password"));
}
Aggregations