Skip to content

Commit

Permalink
Consistent Indices API: Added tests to make sure requests on aliases …
Browse files Browse the repository at this point in the history
…return the concrete index

Relates elastic#4071
  • Loading branch information
spinscale committed Jan 14, 2014
1 parent 284230c commit 4c66c8f
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
26 changes: 26 additions & 0 deletions rest-api-spec/test/indices.get_mapping/40_aliases.yaml
@@ -0,0 +1,26 @@
---
"Getting mapping for aliases should return the real index as key":

- do:
indices.create:
index: test_index
body:
mappings:
test_type:
properties:
text:
type: string
analyzer: whitespace

- do:
indices.put_alias:
index: test_index
name: test_alias

- do:
indices.get_mapping:
index: test_alias

- match: {test_index.test_type.properties.text.type: string}
- match: {test_index.test_type.properties.text.analyzer: whitespace}

26 changes: 26 additions & 0 deletions rest-api-spec/test/indices.get_settings/20_aliases.yaml
@@ -0,0 +1,26 @@
---
"Getting settings for aliases should return the real index as key":

- do:
indices.create:
index: test-index
body:
settings:
index:
refresh_interval: -1
number_of_shards: 2
number_of_replicas: 3

- do:
indices.put_alias:
index: test-index
name: test-alias

- do:
indices.get_settings:
index: test-alias

- match: { test-index.settings.index.number_of_replicas: "3" }
- match: { test-index.settings.index.number_of_shards: "2" }
- match: { test-index.settings.index.refresh_interval: "-1" }

30 changes: 30 additions & 0 deletions rest-api-spec/test/indices.put_warmer/20_aliases.yaml
@@ -0,0 +1,30 @@
---
"Getting warmer for aliases should return the real index as key":

- do:
indices.create:
index: test_index

- do:
cluster.health:
wait_for_status: yellow

- do:
indices.put_warmer:
index: test_index
name: test_warmer
body:
query:
match_all: {}

- do:
indices.put_alias:
index: test_index
name: test_alias

- do:
indices.get_warmer:
index: test_alias

- match: {test_index.warmers.test_warmer.source.query.match_all: {}}

0 comments on commit 4c66c8f

Please sign in to comment.