Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jasontedor committed Jun 11, 2017
1 parent b379a94 commit ae13341
Showing 1 changed file with 86 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
"Return empty response when type doesn't exist":
"Non-existent type returns 404":
- skip:
version: " - 5.99.99"
reason: Previous versions did not 404 on missing types
- do:
indices.create:
index: test_index
Expand All @@ -12,11 +15,91 @@
analyzer: whitespace

- do:
catch: missing
indices.get_mapping:
index: test_index
type: not_test_type

- match: { '': {}}

- match: { status: 404 }
- match: { error.reason: 'type[[not_test_type]] missing' }

---
"No type matching pattern returns 404":
- skip:
version: " - 5.99.99"
reason: Previous versions did not 404 on missing types
- do:
indices.create:
index: test_index
body:
mappings:
test_type:
properties:
text:
type: text
analyzer: whitespace

- do:
catch: missing
indices.get_mapping:
index: test_index
type: test*,not*

- match: { status: 404 }
- match: { error: 'type [not*] missing' }
- is_true: test_index.mappings.test_type

---
"Existent and non-existent type returns 404 and the existing type":
- skip:
version: " - 5.99.99"
reason: Previous versions did not 404 on missing types
- do:
indices.create:
index: test_index
body:
mappings:
test_type:
properties:
text:
type: text
analyzer: whitespace

- do:
catch: missing
indices.get_mapping:
index: test_index
type: test_type,not_test_type

- match: { status: 404 }
- match: { error: 'type [not_test_type] missing' }
- is_true: test_index.mappings.test_type

---
"Existent and non-existent types returns 404 and the existing type":
- skip:
version: " - 5.99.99"
reason: Previous versions did not 404 on missing types
- do:
indices.create:
index: test_index
body:
mappings:
test_type:
properties:
text:
type: text
analyzer: whitespace

- do:
catch: missing
indices.get_mapping:
index: test_index
type: test_type,not_test_type,another_not_test_type

- match: { status: 404 }
- match: { error: 'types [another_not_test_type,not_test_type] missing' }
- is_true: test_index.mappings.test_type

---
"Type missing when no types exist":
Expand Down

0 comments on commit ae13341

Please sign in to comment.