use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse in project sonarqube by SonarSource.
the class ElasticSearchMetricTaskTest method when_elasticsearch_down_status_is_updated_to_red.
@Test
public void when_elasticsearch_down_status_is_updated_to_red() {
ClusterHealthResponse clusterHealthResponse = new ClusterHealthResponse();
clusterHealthResponse.setStatus(ClusterHealthStatus.RED);
when(esClient.clusterHealth(any())).thenReturn(clusterHealthResponse);
underTest.run();
verify(serverMonitoringMetrics, times(1)).setElasticSearchStatusToRed();
verifyNoMoreInteractions(serverMonitoringMetrics);
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse in project sonarqube by SonarSource.
the class ElasticSearchMetricTaskTest method when_no_es_status_null_status_is_updated_to_red.
@Test
public void when_no_es_status_null_status_is_updated_to_red() {
ClusterHealthResponse clusterHealthResponse = Mockito.mock(ClusterHealthResponse.class);
when(clusterHealthResponse.getStatus()).thenReturn(null);
when(esClient.clusterHealth(any())).thenReturn(clusterHealthResponse);
underTest.run();
verify(serverMonitoringMetrics, times(1)).setElasticSearchStatusToRed();
verifyNoMoreInteractions(serverMonitoringMetrics);
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse in project sonarqube by SonarSource.
the class ElasticSearchMetricTaskTest method when_elasticsearch_yellow_status_is_updated_to_green.
@Test
public void when_elasticsearch_yellow_status_is_updated_to_green() {
ClusterHealthResponse clusterHealthResponse = new ClusterHealthResponse();
clusterHealthResponse.setStatus(ClusterHealthStatus.YELLOW);
when(esClient.clusterHealth(any())).thenReturn(clusterHealthResponse);
underTest.run();
verify(serverMonitoringMetrics, times(1)).setElasticSearchStatusToGreen();
verifyNoMoreInteractions(serverMonitoringMetrics);
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse in project sonarqube by SonarSource.
the class ElasticSearchMetricTaskTest method when_elasticsearch_up_status_is_updated_to_green.
@Test
public void when_elasticsearch_up_status_is_updated_to_green() {
ClusterHealthResponse clusterHealthResponse = new ClusterHealthResponse();
clusterHealthResponse.setStatus(ClusterHealthStatus.GREEN);
when(esClient.clusterHealth(any())).thenReturn(clusterHealthResponse);
underTest.run();
verify(serverMonitoringMetrics, times(1)).setElasticSearchStatusToGreen();
verifyNoMoreInteractions(serverMonitoringMetrics);
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse in project elasticsearch by elastic.
the class ClusterStatsIT method waitForNodes.
private void waitForNodes(int numNodes) {
ClusterHealthResponse actionGet = client().admin().cluster().health(Requests.clusterHealthRequest().waitForEvents(Priority.LANGUID).waitForNodes(Integer.toString(numNodes))).actionGet();
assertThat(actionGet.isTimedOut(), is(false));
}
Aggregations