Skip to content

Commit 64f5398

Browse files
[Connector APIs] Update yaml rest tests for Connector APIs (#118260) (#118650)
* [Connector API] Update yaml tests * Update tests --------- Co-authored-by: Elastic Machine <[email protected]>
1 parent 744540d commit 64f5398

File tree

5 files changed

+68
-42
lines changed

5 files changed

+68
-42
lines changed

x-pack/plugin/ent-search/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/entsearch/connector/10_connector_put.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ setup:
5858
connector.put:
5959
connector_id: test-connector-native
6060
body:
61-
index_name: search-test
61+
index_name: content-search-test
6262
is_native: true
6363

6464
- match: { result: 'created' }
@@ -68,7 +68,7 @@ setup:
6868
connector_id: test-connector-native
6969

7070
- match: { id: test-connector-native }
71-
- match: { index_name: search-test }
71+
- match: { index_name: content-search-test }
7272
- match: { is_native: true }
7373
- match: { sync_now: false }
7474
- match: { status: needs_configuration }
@@ -151,6 +151,7 @@ setup:
151151
is_native: false
152152
service_type: super-connector
153153

154+
154155
---
155156
'Create Connector - Id returned as part of response':
156157
- do:

x-pack/plugin/ent-search/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/entsearch/connector/130_connector_update_index_name.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,29 @@ setup:
125125
connector_id: test-connector
126126

127127
- match: { index_name: search-1-test }
128+
129+
130+
---
131+
"Update Managed Connector Index Name":
132+
- do:
133+
connector.put:
134+
connector_id: test-connector-1
135+
body:
136+
is_native: true
137+
service_type: super-connector
138+
139+
- do:
140+
connector.update_index_name:
141+
connector_id: test-connector-1
142+
body:
143+
index_name: content-search-2-test
144+
145+
146+
- match: { result: updated }
147+
148+
- do:
149+
connector.get:
150+
connector_id: test-connector-1
151+
152+
- match: { index_name: content-search-2-test }
153+

x-pack/plugin/ent-search/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/entsearch/connector/140_connector_update_native.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ setup:
77
connector.put:
88
connector_id: test-connector
99
body:
10-
index_name: search-1-test
10+
index_name: content-search-1-test
1111
name: my-connector
1212
language: pl
1313
is_native: false
@@ -29,7 +29,6 @@ setup:
2929
connector_id: test-connector
3030

3131
- match: { is_native: true }
32-
- match: { status: configured }
3332

3433
- do:
3534
connector.update_native:
@@ -44,7 +43,6 @@ setup:
4443
connector_id: test-connector
4544

4645
- match: { is_native: false }
47-
- match: { status: configured }
4846

4947
---
5048
"Update Connector Native - 404 when connector doesn't exist":

x-pack/plugin/ent-search/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/entsearch/connector/15_connector_post.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ setup:
7171
- do:
7272
connector.post:
7373
body:
74-
index_name: search-test
74+
index_name: content-search-test
7575
is_native: true
7676

7777
- set: { id: id }
@@ -82,7 +82,7 @@ setup:
8282
connector_id: $id
8383

8484
- match: { id: $id }
85-
- match: { index_name: search-test }
85+
- match: { index_name: content-search-test }
8686
- match: { is_native: true }
8787
- match: { sync_now: false }
8888
- match: { status: needs_configuration }
@@ -102,6 +102,7 @@ setup:
102102
is_native: false
103103
service_type: super-connector
104104

105+
105106
---
106107
'Create Connector - Index name used by another connector':
107108
- do:

x-pack/plugin/ent-search/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/entsearch/connector/20_connector_list.yml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ setup:
2626
connector.put:
2727
connector_id: connector-b
2828
body:
29-
index_name: search-2-test
29+
index_name: content-search-2-test
3030
name: my-connector-2
3131
language: en
3232
is_native: true
@@ -40,13 +40,13 @@ setup:
4040
- match: { count: 3 }
4141

4242
# Alphabetical order by index_name for results
43-
- match: { results.0.id: "connector-a" }
44-
- match: { results.0.index_name: "search-1-test" }
45-
- match: { results.0.language: "pl" }
43+
- match: { results.0.id: "connector-b" }
44+
- match: { results.0.index_name: "content-search-2-test" }
45+
- match: { results.0.language: "en" }
4646

47-
- match: { results.1.id: "connector-b" }
48-
- match: { results.1.index_name: "search-2-test" }
49-
- match: { results.1.language: "en" }
47+
- match: { results.1.id: "connector-a" }
48+
- match: { results.1.index_name: "search-1-test" }
49+
- match: { results.1.language: "pl" }
5050

5151
- match: { results.2.id: "connector-c" }
5252
- match: { results.2.index_name: "search-3-test" }
@@ -62,9 +62,9 @@ setup:
6262
- match: { count: 3 }
6363

6464
# Alphabetical order by index_name for results
65-
- match: { results.0.id: "connector-b" }
66-
- match: { results.0.index_name: "search-2-test" }
67-
- match: { results.0.language: "en" }
65+
- match: { results.0.id: "connector-a" }
66+
- match: { results.0.index_name: "search-1-test" }
67+
- match: { results.0.language: "pl" }
6868

6969
- match: { results.1.id: "connector-c" }
7070
- match: { results.1.index_name: "search-3-test" }
@@ -79,13 +79,13 @@ setup:
7979
- match: { count: 3 }
8080

8181
# Alphabetical order by index_name for results
82-
- match: { results.0.id: "connector-a" }
83-
- match: { results.0.index_name: "search-1-test" }
84-
- match: { results.0.language: "pl" }
82+
- match: { results.0.id: "connector-b" }
83+
- match: { results.0.index_name: "content-search-2-test" }
84+
- match: { results.0.language: "en" }
8585

86-
- match: { results.1.id: "connector-b" }
87-
- match: { results.1.index_name: "search-2-test" }
88-
- match: { results.1.language: "en" }
86+
- match: { results.1.id: "connector-a" }
87+
- match: { results.1.index_name: "search-1-test" }
88+
- match: { results.1.language: "pl" }
8989

9090
---
9191
"List Connector - empty":
@@ -118,11 +118,11 @@ setup:
118118

119119
- do:
120120
connector.list:
121-
index_name: search-1-test,search-2-test
121+
index_name: search-1-test,content-search-2-test
122122

123123
- match: { count: 2 }
124-
- match: { results.0.index_name: "search-1-test" }
125-
- match: { results.1.index_name: "search-2-test" }
124+
- match: { results.0.index_name: "content-search-2-test" }
125+
- match: { results.1.index_name: "search-1-test" }
126126

127127

128128
---
@@ -147,19 +147,19 @@ setup:
147147
connector_name: my-connector-1,my-connector-2
148148

149149
- match: { count: 2 }
150-
- match: { results.0.name: "my-connector-1" }
151-
- match: { results.1.name: "my-connector-2" }
150+
- match: { results.0.name: "my-connector-2" }
151+
- match: { results.1.name: "my-connector-1" }
152152

153153

154154
---
155155
"List Connector - filter by index name and name":
156156
- do:
157157
connector.list:
158158
connector_name: my-connector-1,my-connector-2
159-
index_name: search-2-test
159+
index_name: content-search-2-test
160160

161161
- match: { count: 1 }
162-
- match: { results.0.index_name: "search-2-test" }
162+
- match: { results.0.index_name: "content-search-2-test" }
163163
- match: { results.0.name: "my-connector-2" }
164164

165165

@@ -230,13 +230,13 @@ setup:
230230
- match: { count: 3 }
231231

232232
# Alphabetical order by index_name for results
233-
- match: { results.0.id: "connector-a" }
234-
- match: { results.0.index_name: "search-1-test" }
235-
- match: { results.0.language: "pl" }
233+
- match: { results.0.id: "connector-b" }
234+
- match: { results.0.index_name: "content-search-2-test" }
235+
- match: { results.0.language: "en" }
236236

237-
- match: { results.1.id: "connector-b" }
238-
- match: { results.1.index_name: "search-2-test" }
239-
- match: { results.1.language: "en" }
237+
- match: { results.1.id: "connector-a" }
238+
- match: { results.1.index_name: "search-1-test" }
239+
- match: { results.1.language: "pl" }
240240

241241
- match: { results.2.id: "connector-c" }
242242
- match: { results.2.index_name: "search-3-test" }
@@ -255,13 +255,13 @@ setup:
255255
- match: { count: 3 }
256256

257257
# Alphabetical order by index_name for results
258-
- match: { results.0.id: "connector-a" }
259-
- match: { results.0.index_name: "search-1-test" }
260-
- match: { results.0.language: "pl" }
258+
- match: { results.0.id: "connector-b" }
259+
- match: { results.0.index_name: "content-search-2-test" }
260+
- match: { results.0.language: "en" }
261261

262-
- match: { results.1.id: "connector-b" }
263-
- match: { results.1.index_name: "search-2-test" }
264-
- match: { results.1.language: "en" }
262+
- match: { results.1.id: "connector-a" }
263+
- match: { results.1.index_name: "search-1-test" }
264+
- match: { results.1.language: "pl" }
265265

266266
- match: { results.2.id: "connector-c" }
267267
- match: { results.2.index_name: "search-3-test" }

0 commit comments

Comments
 (0)