Skip to content

Commit 3b8bbfd

Browse files
committed
Add YAML tests and REST API specs
1 parent ab0805d commit 3b8bbfd

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

rest-api-spec/src/main/resources/rest-api-spec/api/synonyms.put_synonym.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
}
3131
]
3232
},
33+
"params": {
34+
"timeout": {
35+
"type": "time",
36+
"description": "Explicit timeout for the operation to complete"
37+
}
38+
},
3339
"body": {
3440
"description": "Synonyms set rules",
3541
"required": true

rest-api-spec/src/main/resources/rest-api-spec/api/synonyms.put_synonym_rule.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
}
3535
]
3636
},
37+
"params": {
38+
"timeout": {
39+
"type": "time",
40+
"description": "Explicit timeout for the operation to complete"
41+
}
42+
},
3743
"body": {
3844
"description": "Synonym rule",
3945
"required": true

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/10_synonyms_put.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,22 @@ setup:
6565
- match: { count: 0 }
6666
- match: { synonyms_set: [] }
6767

68+
---
69+
"Timeout can be specified":
70+
- do:
71+
synonyms.put_synonym:
72+
id: test-update-synonyms
73+
timeout: 10s
74+
body:
75+
synonyms_set:
76+
- synonyms: "hello, hi"
77+
- synonyms: "bye => goodbye"
78+
id: "test-id"
79+
80+
- match: { result: "created" }
81+
- match: { reload_analyzers_details._shards.total: 0 }
82+
- length: { reload_analyzers_details.reload_details: 0 }
83+
6884
---
6985
"Validation fails tests":
7086
- do:
@@ -106,3 +122,13 @@ setup:
106122
body:
107123
synonyms_set:
108124
- synonyms: "bye, goodbye, "
125+
126+
- do:
127+
catch: /as a time value:\ negative durations are not supported/
128+
synonyms.put_synonym:
129+
id: test-update-synonyms
130+
timeout: -100s
131+
body:
132+
synonyms_set:
133+
- synonyms: "bye, goodbye"
134+

0 commit comments

Comments
 (0)