From 591ea500f27c1e3ca32ce90e6b82523d1f39029d Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 24 Jun 2015 22:29:17 +0200 Subject: [PATCH] test: Fetch the status from the get response itself instead of the watch source Original commit: elastic/x-pack-elasticsearch@ab0f4b8fe940f62386cc2e99be16638e8f524573 --- .../watcher/transport/action/execute/ExecuteWatchTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/elasticsearch/watcher/transport/action/execute/ExecuteWatchTests.java b/src/test/java/org/elasticsearch/watcher/transport/action/execute/ExecuteWatchTests.java index 34c20c5dc86..194cc51b4cd 100644 --- a/src/test/java/org/elasticsearch/watcher/transport/action/execute/ExecuteWatchTests.java +++ b/src/test/java/org/elasticsearch/watcher/transport/action/execute/ExecuteWatchTests.java @@ -38,6 +38,7 @@ import static org.elasticsearch.watcher.input.InputBuilders.simpleInput; import static org.elasticsearch.watcher.trigger.TriggerBuilders.schedule; import static org.elasticsearch.watcher.trigger.schedule.Schedules.cron; import static org.elasticsearch.watcher.trigger.schedule.Schedules.interval; +import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; @@ -297,7 +298,7 @@ public class ExecuteWatchTests extends AbstractWatcherIntegrationTests { @Override public void run() { GetWatchResponse getWatchResponse = watcherClient.prepareGetWatch("_id").get(); - assertValue(getWatchResponse.getSource(), "status.actions.log.ack.state", is("ackable")); + assertThat(getWatchResponse.getStatus().actionStatus("log").ackStatus().state(), equalTo(ActionStatus.AckStatus.State.ACKABLE)); } }); }