Search in sources :

Example 21 with CheckResult

use of zipkin2.CheckResult in project zipkin by openzipkin.

the class ElasticsearchStorageTest method check_fail_onNoContent.

// makes sure we don't NPE
@Test
void check_fail_onNoContent() {
    // assume index templates called before
    storage.ensuredTemplates = true;
    // empty instead of success response
    server.enqueue(SUCCESS_RESPONSE);
    CheckResult result = storage.check();
    assertThat(result.ok()).isFalse();
    assertThat(result.error().getMessage()).isEqualTo("No content reading Elasticsearch version");
}
Also used : CheckResult(zipkin2.CheckResult) Test(org.junit.jupiter.api.Test)

Example 22 with CheckResult

use of zipkin2.CheckResult in project zipkin by openzipkin.

the class ElasticsearchStorageTest method check_unauthorized.

// TODO: when Armeria's mock server supports it, add a test for IOException
@Test
void check_unauthorized() {
    server.enqueue(RESPONSE_UNAUTHORIZED);
    CheckResult result = storage.check();
    assertThat(result.ok()).isFalse();
    assertThat(result.error().getMessage()).isEqualTo("User: anonymous is not authorized to perform: es:ESHttpGet");
}
Also used : CheckResult(zipkin2.CheckResult) Test(org.junit.jupiter.api.Test)

Aggregations

CheckResult (zipkin2.CheckResult)22 Test (org.junit.Test)12 Test (org.junit.jupiter.api.Test)5 ElasticsearchStorage (zipkin2.elasticsearch.ElasticsearchStorage)4 CompletableFuture (java.util.concurrent.CompletableFuture)2 Future (java.util.concurrent.Future)2 Component (zipkin2.Component)2 AggregatedHttpRequest (com.linecorp.armeria.common.AggregatedHttpRequest)1 IOException (java.io.IOException)1 UncheckedIOException (java.io.UncheckedIOException)1 SQLException (java.sql.SQLException)1 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)1 DataSource (javax.sql.DataSource)1 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1 Span (zipkin2.Span)1 QueryRequest (zipkin2.storage.QueryRequest)1