Browse Source

[Connector APIs] Update yaml rest tests for Connector APIs (#118260) (#118651)

* [Connector API] Update yaml tests

* Update tests

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Jedr Blaszyk 10 months ago
parent
commit
3a2dc1eb48

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

@@ -58,7 +58,7 @@ setup:
       connector.put:
         connector_id: test-connector-native
         body:
-          index_name: search-test
+          index_name: content-search-test
           is_native: true
 
   - match: { result: 'created' }
@@ -68,7 +68,7 @@ setup:
         connector_id: test-connector-native
 
   - match: { id: test-connector-native }
-  - match: { index_name: search-test }
+  - match: { index_name: content-search-test }
   - match: { is_native: true }
   - match: { sync_now: false }
   - match: { status: needs_configuration }
@@ -151,6 +151,7 @@ setup:
           is_native: false
           service_type: super-connector
 
+
 ---
 'Create Connector - Id returned as part of response':
   - do:

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

@@ -125,3 +125,29 @@ setup:
         connector_id: test-connector
 
   - match: { index_name: search-1-test }
+
+
+---
+"Update Managed Connector Index Name":
+  - do:
+      connector.put:
+        connector_id: test-connector-1
+        body:
+          is_native: true
+          service_type: super-connector
+
+  - do:
+      connector.update_index_name:
+        connector_id: test-connector-1
+        body:
+          index_name: content-search-2-test
+
+
+  - match: { result: updated }
+
+  - do:
+      connector.get:
+        connector_id: test-connector-1
+
+  - match: { index_name: content-search-2-test }
+

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

@@ -7,7 +7,7 @@ setup:
       connector.put:
         connector_id: test-connector
         body:
-          index_name: search-1-test
+          index_name: content-search-1-test
           name: my-connector
           language: pl
           is_native: false
@@ -29,7 +29,6 @@ setup:
         connector_id: test-connector
 
   - match: { is_native: true }
-  - match: { status: configured }
 
   - do:
       connector.update_native:
@@ -44,7 +43,6 @@ setup:
         connector_id: test-connector
 
   - match: { is_native: false }
-  - match: { status: configured }
 
 ---
 "Update Connector Native - 404 when connector doesn't exist":

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

@@ -71,7 +71,7 @@ setup:
   - do:
       connector.post:
         body:
-          index_name: search-test
+          index_name: content-search-test
           is_native: true
 
   - set:  { id: id }
@@ -82,7 +82,7 @@ setup:
         connector_id: $id
 
   - match: { id: $id }
-  - match: { index_name: search-test }
+  - match: { index_name: content-search-test }
   - match: { is_native: true }
   - match: { sync_now: false }
   - match: { status: needs_configuration }
@@ -102,6 +102,7 @@ setup:
           is_native: false
           service_type: super-connector
 
+
 ---
 'Create Connector - Index name used by another connector':
   - do:

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

@@ -26,7 +26,7 @@ setup:
       connector.put:
         connector_id: connector-b
         body:
-          index_name: search-2-test
+          index_name: content-search-2-test
           name: my-connector-2
           language: en
           is_native: true
@@ -40,13 +40,13 @@ setup:
   - match: { count: 3 }
 
   # Alphabetical order by index_name for results
-  - match: { results.0.id: "connector-a" }
-  - match: { results.0.index_name: "search-1-test" }
-  - match: { results.0.language: "pl" }
+  - match: { results.0.id: "connector-b" }
+  - match: { results.0.index_name: "content-search-2-test" }
+  - match: { results.0.language: "en" }
 
-  - match: { results.1.id: "connector-b" }
-  - match: { results.1.index_name: "search-2-test" }
-  - match: { results.1.language: "en" }
+  - match: { results.1.id: "connector-a" }
+  - match: { results.1.index_name: "search-1-test" }
+  - match: { results.1.language: "pl" }
 
   - match: { results.2.id: "connector-c" }
   - match: { results.2.index_name: "search-3-test" }
@@ -62,9 +62,9 @@ setup:
   - match: { count: 3 }
 
   # Alphabetical order by index_name for results
-  - match: { results.0.id: "connector-b" }
-  - match: { results.0.index_name: "search-2-test" }
-  - match: { results.0.language: "en" }
+  - match: { results.0.id: "connector-a" }
+  - match: { results.0.index_name: "search-1-test" }
+  - match: { results.0.language: "pl" }
 
   - match: { results.1.id: "connector-c" }
   - match: { results.1.index_name: "search-3-test" }
@@ -79,13 +79,13 @@ setup:
   - match: { count: 3 }
 
   # Alphabetical order by index_name for results
-  - match: { results.0.id: "connector-a" }
-  - match: { results.0.index_name: "search-1-test" }
-  - match: { results.0.language: "pl" }
+  - match: { results.0.id: "connector-b" }
+  - match: { results.0.index_name: "content-search-2-test" }
+  - match: { results.0.language: "en" }
 
-  - match: { results.1.id: "connector-b" }
-  - match: { results.1.index_name: "search-2-test" }
-  - match: { results.1.language: "en" }
+  - match: { results.1.id: "connector-a" }
+  - match: { results.1.index_name: "search-1-test" }
+  - match: { results.1.language: "pl" }
 
 ---
 "List Connector - empty":
@@ -118,11 +118,11 @@ setup:
 
   - do:
       connector.list:
-        index_name: search-1-test,search-2-test
+        index_name: search-1-test,content-search-2-test
 
   - match: { count: 2 }
-  - match: { results.0.index_name: "search-1-test" }
-  - match: { results.1.index_name: "search-2-test" }
+  - match: { results.0.index_name: "content-search-2-test" }
+  - match: { results.1.index_name: "search-1-test" }
 
 
 ---
@@ -147,8 +147,8 @@ setup:
         connector_name: my-connector-1,my-connector-2
 
   - match: { count: 2 }
-  - match: { results.0.name: "my-connector-1" }
-  - match: { results.1.name: "my-connector-2" }
+  - match: { results.0.name: "my-connector-2" }
+  - match: { results.1.name: "my-connector-1" }
 
 
 ---
@@ -156,10 +156,10 @@ setup:
   - do:
       connector.list:
         connector_name: my-connector-1,my-connector-2
-        index_name: search-2-test
+        index_name: content-search-2-test
 
   - match: { count: 1 }
-  - match: { results.0.index_name: "search-2-test" }
+  - match: { results.0.index_name: "content-search-2-test" }
   - match: { results.0.name: "my-connector-2" }
 
 
@@ -230,13 +230,13 @@ setup:
   - match: { count: 3 }
 
   # Alphabetical order by index_name for results
-  - match: { results.0.id: "connector-a" }
-  - match: { results.0.index_name: "search-1-test" }
-  - match: { results.0.language: "pl" }
+  - match: { results.0.id: "connector-b" }
+  - match: { results.0.index_name: "content-search-2-test" }
+  - match: { results.0.language: "en" }
 
-  - match: { results.1.id: "connector-b" }
-  - match: { results.1.index_name: "search-2-test" }
-  - match: { results.1.language: "en" }
+  - match: { results.1.id: "connector-a" }
+  - match: { results.1.index_name: "search-1-test" }
+  - match: { results.1.language: "pl" }
 
   - match: { results.2.id: "connector-c" }
   - match: { results.2.index_name: "search-3-test" }
@@ -255,13 +255,13 @@ setup:
   - match: { count: 3 }
 
   # Alphabetical order by index_name for results
-  - match: { results.0.id: "connector-a" }
-  - match: { results.0.index_name: "search-1-test" }
-  - match: { results.0.language: "pl" }
+  - match: { results.0.id: "connector-b" }
+  - match: { results.0.index_name: "content-search-2-test" }
+  - match: { results.0.language: "en" }
 
-  - match: { results.1.id: "connector-b" }
-  - match: { results.1.index_name: "search-2-test" }
-  - match: { results.1.language: "en" }
+  - match: { results.1.id: "connector-a" }
+  - match: { results.1.index_name: "search-1-test" }
+  - match: { results.1.language: "pl" }
 
   - match: { results.2.id: "connector-c" }
   - match: { results.2.index_name: "search-3-test" }