File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -221,3 +221,44 @@ teardown:
221221 index : test
222222 id : " 2"
223223 catch : missing
224+
225+ ---
226+ " Test conditionals support params and statements " :
227+ - do :
228+ ingest.put_pipeline :
229+ id : " my_pipeline"
230+ body : >
231+ {
232+ "description": "_description",
233+ "processors": [
234+ {
235+ "set" : {
236+ "if" : {
237+ "source": "def hit = params.success_codes.containsKey(ctx.code); return hit != null && hit == true;",
238+ "params": {
239+ "success_codes" : {
240+ "10": true,
241+ "20": true
242+ }
243+ }
244+ },
245+ "field" : "result",
246+ "value" : "success"
247+ }
248+ }
249+ ]
250+ }
251+ - match : { acknowledged: true }
252+
253+ - do :
254+ index :
255+ index : test
256+ id : " 1"
257+ pipeline : " my_pipeline"
258+ body : { code: "20" }
259+
260+ - do :
261+ get :
262+ index : test
263+ id : " 1"
264+ - match : { _source.result: "success" }
You can’t perform that action at this time.
0 commit comments