|
91 | 91 | import static org.elasticsearch.common.xcontent.support.XContentMapValues.extractRawValues;
|
92 | 92 | import static org.elasticsearch.common.xcontent.support.XContentMapValues.extractValue;
|
93 | 93 | import static org.hamcrest.CoreMatchers.hasItem;
|
| 94 | +import static org.hamcrest.Matchers.arrayContainingInAnyOrder; |
94 | 95 | import static org.hamcrest.Matchers.contains;
|
95 | 96 | import static org.hamcrest.Matchers.containsString;
|
96 | 97 | import static org.hamcrest.Matchers.equalTo;
|
@@ -1045,10 +1046,8 @@ public void testGetIndexTemplate() throws Exception {
|
1045 | 1046 | }
|
1046 | 1047 | GetIndexTemplatesResponse getBoth = execute(getBothRequest, client.indices()::getTemplates, client.indices()::getTemplatesAsync);
|
1047 | 1048 | assertThat(getBoth.getIndexTemplates(), hasSize(2));
|
1048 |
| - assertThat(getBoth.getIndexTemplates().get(0).name(), equalTo("template-1")); |
1049 |
| - assertThat(getBoth.getIndexTemplates().get(0).patterns(), contains("pattern-1", "name-1")); |
1050 |
| - assertThat(getBoth.getIndexTemplates().get(1).name(), equalTo("template-2")); |
1051 |
| - assertThat(getBoth.getIndexTemplates().get(1).patterns(), contains("pattern-2", "name-2")); |
| 1049 | + assertThat(getBoth.getIndexTemplates().stream().map(IndexTemplateMetaData::getName).toArray(), |
| 1050 | + arrayContainingInAnyOrder("template-1", "template-2")); |
1052 | 1051 |
|
1053 | 1052 | ElasticsearchException notFound = expectThrows(ElasticsearchException.class, () -> execute(
|
1054 | 1053 | new GetIndexTemplatesRequest().names("the-template-*"), client.indices()::getTemplates, client.indices()::getTemplatesAsync));
|
|
0 commit comments