Search in sources :

Example 1 with ClusterHealthRequestBuilder

use of org.elasticsearch.action.admin.cluster.health.ClusterHealthRequestBuilder in project sonarqube by SonarSource.

the class ProxyClusterHealthRequestBuilderTest method trace_logs.

@Test
public void trace_logs() {
    logTester.setLevel(LoggerLevel.TRACE);
    ClusterHealthRequestBuilder requestBuilder = esTester.client().prepareHealth();
    ClusterHealthResponse state = requestBuilder.get();
    assertThat(state.getStatus()).isEqualTo(ClusterHealthStatus.GREEN);
    assertThat(logTester.logs()).hasSize(1);
}
Also used : ClusterHealthResponse(org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse) ClusterHealthRequestBuilder(org.elasticsearch.action.admin.cluster.health.ClusterHealthRequestBuilder) Test(org.junit.Test)

Example 2 with ClusterHealthRequestBuilder

use of org.elasticsearch.action.admin.cluster.health.ClusterHealthRequestBuilder in project sonarqube by SonarSource.

the class ProxyClusterHealthRequestBuilderTest method state.

@Test
public void state() {
    ClusterHealthRequestBuilder requestBuilder = esTester.client().prepareHealth();
    ClusterHealthResponse state = requestBuilder.get();
    assertThat(state.getStatus()).isEqualTo(ClusterHealthStatus.GREEN);
}
Also used : ClusterHealthResponse(org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse) ClusterHealthRequestBuilder(org.elasticsearch.action.admin.cluster.health.ClusterHealthRequestBuilder) Test(org.junit.Test)

Aggregations

ClusterHealthRequestBuilder (org.elasticsearch.action.admin.cluster.health.ClusterHealthRequestBuilder)2 ClusterHealthResponse (org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse)2 Test (org.junit.Test)2