From 733c1077f7b05ee2ab25c5db9452043ec28896cd Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Thu, 13 Apr 2017 16:45:24 +0100 Subject: [PATCH] Tests: Reenable and fix watcher tests for ackable state Original commit: elastic/x-pack-elasticsearch@8a53f508b75cc706d912f54e2774ca53ee9b7e7c --- .../test/watcher/execute_watch/10_basic.yaml | 46 +++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/plugin/src/test/resources/rest-api-spec/test/watcher/execute_watch/10_basic.yaml b/plugin/src/test/resources/rest-api-spec/test/watcher/execute_watch/10_basic.yaml index acb0f855575..f03b61ce824 100644 --- a/plugin/src/test/resources/rest-api-spec/test/watcher/execute_watch/10_basic.yaml +++ b/plugin/src/test/resources/rest-api-spec/test/watcher/execute_watch/10_basic.yaml @@ -30,9 +30,11 @@ teardown: "always": {} }, "actions": { - "log" : { - "logging" : { - "text" : "execute_watch/10.yaml payload" + "indexme" : { + "index" : { + "index" : "my-index", + "doc_type" : "my-type", + "doc_id": "my-id" } } } @@ -57,6 +59,44 @@ teardown: - match: { watch_record.trigger_event.manual.schedule.scheduled_time: "2000-12-12T12:12:12.120Z" } - match: { watch_record.state: "executed" } - match: { watch_record._status.state.active: true } + - match: { watch_record._status.actions.indexme.ack.state: "ackable" } + +--- +"Test execute watch API with user supplied watch": + + - do: + xpack.watcher.execute_watch: + body: > + { + "watch" : { + "trigger": { + "schedule" : { "cron" : "0 0 0 1 * ? 2099" } + }, + "input": { + "simple": { + "foo": "bar" + } + }, + "condition": { + "always": {} + }, + "actions": { + "indexme" : { + "index" : { + "index" : "my-index", + "doc_type" : "my-type", + "doc_id": "my-id" + } + } + } + } + } + + - match: { watch_record.watch_id: "_inlined_" } + - match: { watch_record.trigger_event.type: "manual" } + - match: { watch_record.state: "executed" } + - match: { watch_record._status.state.active: true } + - match: { watch_record._status.actions.indexme.ack.state: "ackable" } --- "Execute unknown watch results in 404":