test: Fetch the status from the get response itself instead of the watch source

Original commit: elastic/x-pack-elasticsearch@ab0f4b8fe9
This commit is contained in:
Martijn van Groningen 2015-06-24 22:29:17 +02:00
parent ba17333523
commit 591ea500f2
1 changed files with 2 additions and 1 deletions

View File

@ -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));
}
});
}