diff --git a/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java b/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java index d1aefb40008..1e40b31a24c 100644 --- a/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java +++ b/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java @@ -659,9 +659,8 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase { } Map getRollupJobResponse = entityAsMap(client().performRequest(getRollupJobRequest)); Map job = getJob(getRollupJobResponse, rollupJob); - if (job != null) { - assertThat(ObjectPath.eval("status.job_state", job), expectedStates); - } + assertNotNull(job); + assertThat(ObjectPath.eval("status.job_state", job), expectedStates); // check that the rollup job is started using the Tasks API final Request taskRequest = new Request("GET", "_tasks"); @@ -712,9 +711,8 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase { assertThat(getRollupJobResponse.getStatusLine().getStatusCode(), equalTo(RestStatus.OK.getStatus())); Map job = getJob(getRollupJobResponse, rollupJob); - if (job != null) { - assertThat(ObjectPath.eval("status.job_state", job), expectedStates); - } + assertNotNull(job); + assertThat(ObjectPath.eval("status.job_state", job), expectedStates); }, 30L, TimeUnit.SECONDS); }