use of com.spotify.docker.client.DockerClient in project opennms by OpenNMS.
the class SyslogKafkaElasticsearchBufferingIT method getServiceAddress.
protected static InetSocketAddress getServiceAddress(AbstractTestEnvironment env, ContainerAlias alias, int port, String protocol) {
try {
// Fetch an up-to-date ContainerInfo for the ELASTICSEARCH_5 container
final DockerClient docker = env.getDockerClient();
final String id = env.getContainerInfo(alias).id();
ContainerInfo info = docker.inspectContainer(id);
return env.getServiceAddress(info, port, protocol);
} catch (DockerException | InterruptedException e) {
LOG.error("Unexpected exception trying to fetch Elassticsearch port", e);
return null;
}
}
Aggregations