diff --git a/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkResponse.java b/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkResponse.java index 61c8cd1b00a..12192da0bb2 100644 --- a/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkResponse.java +++ b/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkResponse.java @@ -60,14 +60,13 @@ public class MonitoringBulkResponse extends ActionResponse { * Returns HTTP status * * */ public RestStatus status() { if (error == null) { - return ignored ? RestStatus.ACCEPTED : RestStatus.OK; + return RestStatus.OK; } return RestStatus.INTERNAL_SERVER_ERROR; diff --git a/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkResponseTests.java b/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkResponseTests.java index f67b75bd487..3ac7f2de63c 100644 --- a/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkResponseTests.java +++ b/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkResponseTests.java @@ -30,19 +30,22 @@ public class MonitoringBulkResponseTests extends ESTestCase { assertThat(response.getTookInMillis(), equalTo(took)); assertThat(response.getError(), is(nullValue())); + assertThat(response.isIgnored(), is(false)); assertThat(response.status(), equalTo(RestStatus.OK)); response = new MonitoringBulkResponse(took, true); assertThat(response.getTookInMillis(), equalTo(took)); assertThat(response.getError(), is(nullValue())); - assertThat(response.status(), equalTo(RestStatus.ACCEPTED)); + assertThat(response.isIgnored(), is(true)); + assertThat(response.status(), equalTo(RestStatus.OK)); ExportException exception = new ExportException(randomAlphaOfLength(10)); response = new MonitoringBulkResponse(took, new MonitoringBulkResponse.Error(exception)); assertThat(response.getTookInMillis(), equalTo(took)); assertThat(response.getError(), is(notNullValue())); + assertThat(response.isIgnored(), is(false)); assertThat(response.status(), equalTo(RestStatus.INTERNAL_SERVER_ERROR)); } diff --git a/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkActionTests.java b/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkActionTests.java index e06e06dac40..2bd25666ab8 100644 --- a/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkActionTests.java +++ b/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkActionTests.java @@ -134,7 +134,7 @@ public class TransportMonitoringBulkActionTests extends ESTestCase { final MonitoringBulkResponse response = action.execute(request).get(); - assertThat(response.status(), is(RestStatus.ACCEPTED)); + assertThat(response.status(), is(RestStatus.OK)); assertThat(response.isIgnored(), is(true)); assertThat(response.getTookInMillis(), is(0L)); assertThat(response.getError(), nullValue()); diff --git a/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkActionTests.java b/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkActionTests.java index 9e88ace46e7..bd96be6c928 100644 --- a/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkActionTests.java +++ b/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkActionTests.java @@ -128,7 +128,7 @@ public class RestMonitoringBulkActionTests extends ESTestCase { final FakeRestRequest request = createRestRequest(randomSystemId(), TEMPLATE_VERSION, "10s"); final RestResponse restResponse = getRestBuilderListener(request).buildResponse(response); - assertThat(restResponse.status(), is(RestStatus.ACCEPTED)); + assertThat(restResponse.status(), is(RestStatus.OK)); assertThat(restResponse.content().utf8ToString(), is("{\"took\":" + response.getTookInMillis() + ",\"ignored\":true,\"errors\":false}")); }