Skip to content

Commit 5a8209a

Browse files
committed
Add YAML tests
1 parent f36056f commit 5a8209a

File tree

3 files changed

+38
-37
lines changed

3 files changed

+38
-37
lines changed

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

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,39 +66,29 @@ setup:
6666
- match: { synonyms_set: [] }
6767

6868
---
69-
"Timeout can be specified":
69+
"Refresh can be specified":
7070

7171
- requires:
7272
test_runner_features: [ capabilities ]
7373
capabilities:
7474
- method: PUT
7575
path: /_synonyms/{rule_id}
76-
capabilities: [ put_synonyms_timeout ]
77-
reason: "synonyms timeout capability needed"
76+
capabilities: [ synonyms_refresh_param ]
77+
reason: "synonyms refresh param capability needed"
7878

7979
- do:
8080
synonyms.put_synonym:
8181
id: test-update-synonyms
82-
timeout: 10s
82+
refresh: false
8383
body:
8484
synonyms_set:
8585
- synonyms: "hello, hi"
8686
- synonyms: "bye => goodbye"
8787
id: "test-id"
8888

8989
- match: { result: "created" }
90-
- match: { reload_analyzers_details._shards.total: 0 }
91-
- length: { reload_analyzers_details.reload_details: 0 }
92-
93-
# Validate timeout values
94-
- do:
95-
catch: /as a time value:\ negative durations are not supported/
96-
synonyms.put_synonym:
97-
id: test-update-synonyms
98-
timeout: -100s
99-
body:
100-
synonyms_set:
101-
- synonyms: "bye, goodbye"
90+
# Reload analyzers info is not included
91+
- not_exists: reload_analyzers_details
10292

10393
---
10494
"Validation fails tests":

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/50_synonym_rule_put.yml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -81,37 +81,27 @@ setup:
8181
synonyms: "i-phone, iphone"
8282

8383
---
84-
"Timeout can be specified":
84+
"Refresh can be specified":
85+
8586
- requires:
8687
test_runner_features: [ capabilities ]
8788
capabilities:
8889
- method: PUT
89-
path: /_synonyms/{set_id}/{rule_id}
90-
capabilities: [ put_synonyms_timeout ]
91-
reason: "synonyms timeout capability needed"
90+
path: /_synonyms/{rule_id}
91+
capabilities: [ synonyms_refresh_param ]
92+
reason: "synonyms refresh param capability needed"
9293

9394
- do:
9495
synonyms.put_synonym_rule:
96+
refresh: false
9597
set_id: "test-synonyms"
96-
rule_id: "test-id-0"
97-
timeout: 10s
98+
rule_id: "test-id-2"
9899
body:
99-
synonyms: "i-phone, iphone"
100-
101-
- match: { result: "created" }
102-
- match: { reload_analyzers_details._shards.total: 0 }
103-
- length: { reload_analyzers_details.reload_details: 0 }
100+
synonyms: "bye, goodbye, seeya"
104101

105-
# Validates timeout values
106-
- do:
107-
catch: /as a time value:\ negative durations are not supported/
108-
synonyms.put_synonym_rule:
109-
set_id: "test-synonyms"
110-
rule_id: "test-id-0"
111-
timeout: -100s
112-
body:
113-
synonyms_set:
114-
- synonyms: "bye, goodbye"
102+
- match: { result: "updated" }
103+
# Reload analyzers info is not included
104+
- not_exists: reload_analyzers_details
115105

116106
---
117107
"Validation failure tests":

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/70_synonym_rule_delete.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,27 @@ setup:
4444
- synonyms: "test => check"
4545
id: "test-id-3"
4646

47+
---
48+
"Refresh can be specified":
49+
50+
- requires:
51+
test_runner_features: [ capabilities ]
52+
capabilities:
53+
- method: PUT
54+
path: /_synonyms/{rule_id}
55+
capabilities: [ synonyms_refresh_param ]
56+
reason: "synonyms refresh param capability needed"
57+
58+
- do:
59+
synonyms.delete_synonym_rule:
60+
set_id: test-synonyms
61+
rule_id: test-id-2
62+
refresh: false
63+
64+
- match: { result: "deleted" }
65+
# Reload analyzers info is not included
66+
- not_exists: reload_analyzers_details
67+
4768
---
4869
"Delete synonym rule - missing synonym set":
4970
- do:

0 commit comments

Comments
 (0)