Search in sources :

Example 1 with ElasticsearchHttpStorage

use of zipkin.storage.elasticsearch.http.ElasticsearchHttpStorage in project zipkin by openzipkin.

the class LazyElasticsearchHttpStorage method compute.

@Override
protected ElasticsearchHttpStorage compute() {
    try {
        container = new GenericContainer(image).withExposedPorts(9200).waitingFor(new HttpWaitStrategy().forPath("/"));
        container.start();
        System.out.println("Will use TestContainers Elasticsearch instance");
    } catch (Exception e) {
    // Ignore
    }
    ElasticsearchHttpStorage result = computeStorageBuilder().build();
    Component.CheckResult check = result.check();
    if (check.ok) {
        return result;
    } else {
        throw new AssumptionViolatedException(check.exception.getMessage(), check.exception);
    }
}
Also used : AssumptionViolatedException(org.junit.AssumptionViolatedException) HttpWaitStrategy(org.testcontainers.containers.wait.HttpWaitStrategy) ElasticsearchHttpStorage(zipkin.storage.elasticsearch.http.ElasticsearchHttpStorage) GenericContainer(org.testcontainers.containers.GenericContainer) Component(zipkin.Component) AssumptionViolatedException(org.junit.AssumptionViolatedException)

Aggregations

AssumptionViolatedException (org.junit.AssumptionViolatedException)1 GenericContainer (org.testcontainers.containers.GenericContainer)1 HttpWaitStrategy (org.testcontainers.containers.wait.HttpWaitStrategy)1 Component (zipkin.Component)1 ElasticsearchHttpStorage (zipkin.storage.elasticsearch.http.ElasticsearchHttpStorage)1