-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Complete variations of /{index}/alias/{name} tests, add tests for HEA…
…D, bulk, analyzers. (#519) * Added HEAD / tests. * Detailed where to start adding tests by using the test coverage report. * Complete alias tests. * Added tests for PUT /_bulk and /{index}/_bulk. * Added tests for /_analyze and /{index}/_analyze. Signed-off-by: dblock <[email protected]>
- Loading branch information
Showing
13 changed files
with
409 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
$schema: ../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test /_alias variants. | ||
epilogues: | ||
- path: /movies/_alias/film* | ||
method: DELETE | ||
status: [200, 404] | ||
- path: /movies | ||
method: DELETE | ||
status: [200, 404] | ||
prologues: | ||
- path: /{index} | ||
method: PUT | ||
parameters: | ||
index: movies | ||
chapters: | ||
- synopsis: Create an alias (index in body). | ||
path: /_alias/{name} | ||
method: PUT | ||
parameters: | ||
name: film1 | ||
request: | ||
payload: | ||
index: movies | ||
response: | ||
status: 200 | ||
payload: | ||
acknowledged: true | ||
- synopsis: Create an alias (index in body). | ||
path: /_alias/{name} | ||
method: POST | ||
parameters: | ||
name: film2 | ||
request: | ||
payload: | ||
index: movies | ||
response: | ||
status: 200 | ||
payload: | ||
acknowledged: true | ||
- synopsis: Create an alias (index & alias in body). | ||
path: /_alias | ||
method: PUT | ||
request: | ||
payload: | ||
index: movies | ||
alias: film3 | ||
response: | ||
status: 200 | ||
payload: | ||
acknowledged: true | ||
- synopsis: Get all aliases. | ||
path: /_alias | ||
method: GET | ||
response: | ||
status: 200 | ||
- synopsis: Get an alias by name. | ||
path: /_alias/{name} | ||
parameters: | ||
name: film1 | ||
method: GET | ||
response: | ||
status: 200 | ||
- synopsis: Get an alias by name. | ||
path: /_alias/{name} | ||
parameters: | ||
name: invalid | ||
method: GET | ||
response: | ||
status: 404 | ||
- synopsis: Check that an alias exists. | ||
path: /_alias/{name} | ||
parameters: | ||
name: film1 | ||
method: HEAD | ||
response: | ||
status: 200 | ||
- synopsis: Check that an alias exists. | ||
path: /_alias/{name} | ||
parameters: | ||
name: invalid | ||
method: HEAD | ||
response: | ||
status: 404 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
$schema: ../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test aliases endpoints. | ||
epilogues: | ||
- path: /games/_alias/* | ||
method: DELETE | ||
status: [200, 404] | ||
- path: /games | ||
method: DELETE | ||
status: [200, 404] | ||
prologues: | ||
- path: games | ||
method: PUT | ||
- path: /games/_aliases/jeux | ||
method: PUT | ||
chapters: | ||
- synopsis: Multiple alias operations. | ||
path: /_aliases | ||
method: POST | ||
request: | ||
payload: | ||
actions: | ||
- remove: | ||
index: games | ||
alias: jeux | ||
- add: | ||
index: games | ||
alias: plays1 | ||
- add: | ||
index: games | ||
alias: plays2 | ||
response: | ||
status: 200 | ||
payload: | ||
acknowledged: true | ||
- synopsis: Create an alias. | ||
path: /_aliases/{name} | ||
method: POST | ||
parameters: | ||
name: plays3 | ||
request: | ||
payload: | ||
index: games | ||
response: | ||
status: 200 | ||
payload: | ||
acknowledged: true | ||
- synopsis: Update an alias. | ||
path: /_aliases/{name} | ||
method: PUT | ||
parameters: | ||
name: plays4 | ||
request: | ||
payload: | ||
index: games | ||
response: | ||
status: 200 | ||
payload: | ||
acknowledged: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
$schema: ../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test /_analyze. | ||
epilogues: [] | ||
prologues: [] | ||
chapters: | ||
- synopsis: Analyze text. | ||
path: /_analyze | ||
method: POST | ||
request: | ||
payload: | ||
analyzer: standard | ||
text: Moneyball, directed by Bennett Miller | ||
response: | ||
status: 200 | ||
payload: | ||
tokens: | ||
- token: moneyball | ||
start_offset: 0 | ||
end_offset: 9 | ||
position: 0 | ||
- synopsis: Analyze text as a multi-value field. | ||
path: /_analyze | ||
method: GET | ||
request: | ||
payload: | ||
analyzer: standard | ||
text: | ||
- Drive, directed by Nicolas Winding Refn | ||
- Moneyball, directed by Bennett Miller | ||
response: | ||
status: 200 | ||
- synopsis: Apply a filter. | ||
path: /_analyze | ||
method: GET | ||
request: | ||
payload: | ||
tokenizer: keyword | ||
filter: | ||
- uppercase | ||
text: Moneyball | ||
response: | ||
status: 200 | ||
payload: | ||
tokens: | ||
- token: MONEYBALL | ||
type: word | ||
start_offset: 0 | ||
end_offset: 9 | ||
position: 0 | ||
- synopsis: Apply a character filter. | ||
path: /_analyze | ||
method: GET | ||
request: | ||
payload: | ||
tokenizer: keyword | ||
filter: | ||
- lowercase | ||
char_filter: | ||
- html_strip | ||
text: <b>Moneyball</b> | ||
response: | ||
status: 200 | ||
payload: | ||
tokens: | ||
- token: moneyball | ||
type: word | ||
start_offset: 3 | ||
end_offset: 16 | ||
position: 0 | ||
- synopsis: Combine a lowercase translation with a stop filter. | ||
path: /_analyze | ||
method: GET | ||
request: | ||
payload: | ||
tokenizer: whitespace | ||
filter: | ||
- lowercase | ||
- type: stop | ||
stopwords: | ||
- in | ||
- to | ||
text: Moneyball directed by Bennett Miller | ||
response: | ||
status: 200 | ||
payload: | ||
tokens: | ||
- token: moneyball | ||
type: word | ||
start_offset: 0 | ||
end_offset: 9 | ||
position: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.