diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/prelert/integration/PrelertJobIT.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/prelert/integration/PrelertJobIT.java index 058586f2170..3cec53e8cce 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/prelert/integration/PrelertJobIT.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/prelert/integration/PrelertJobIT.java @@ -264,13 +264,15 @@ public class PrelertJobIT extends ESRestTestCase { client().performRequest("post", PrelertPlugin.BASE_PATH + "jobs/farequote/_pause"); assertBusy(() -> { try { - Response response = client().performRequest("get", PrelertPlugin.BASE_PATH + "jobs/farequote"); + Response response = client().performRequest("get", PrelertPlugin.BASE_PATH + "jobs/farequote", + Collections.singletonMap("metric", "config,status")); String responseEntityToString = responseEntityToString(response); assertThat(responseEntityToString, containsString("\"ignoreDowntime\":\"ONCE\"")); + assertThat(responseEntityToString, containsString("\"status\":\"PAUSED\"")); } catch (Exception e1) { fail(); } - }, 2, TimeUnit.SECONDS); + }); e = expectThrows(ResponseException.class, () -> client().performRequest("post", PrelertPlugin.BASE_PATH + "jobs/farequote/_pause"));