mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-27 15:39:49 +00:00
[TEST] adapt test: delete index doesn't resolve to aliases anymore (elastic/x-pack-elasticsearch#1735)
Original commit: elastic/x-pack-elasticsearch@49629ccea6
This commit is contained in:
parent
d526461bd2
commit
f0c026d1d9
@ -21,6 +21,7 @@ import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsAction
|
||||
import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest;
|
||||
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingAction;
|
||||
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
|
||||
import org.elasticsearch.action.admin.indices.refresh.RefreshRequest;
|
||||
import org.elasticsearch.action.bulk.BulkRequest;
|
||||
import org.elasticsearch.action.fieldcaps.FieldCapabilitiesAction;
|
||||
import org.elasticsearch.action.fieldcaps.FieldCapabilitiesRequest;
|
||||
@ -1107,13 +1108,23 @@ public class IndicesAndAliasesResolverTests extends ESTestCase {
|
||||
}
|
||||
|
||||
public void testResolveAdminAction() {
|
||||
DeleteIndexRequest request = new DeleteIndexRequest("*");
|
||||
{
|
||||
RefreshRequest request = new RefreshRequest("*");
|
||||
Set<String> indices = defaultIndicesResolver.resolve(request, metaData, buildAuthorizedIndices(user, DeleteIndexAction.NAME));
|
||||
String[] expectedIndices = new String[]{"bar", "bar-closed", "foofoobar", "foofoo", "foofoo-closed"};
|
||||
String[] expectedIndices = new String[]{"bar", "foofoobar", "foofoo"};
|
||||
assertThat(indices.size(), equalTo(expectedIndices.length));
|
||||
assertThat(indices, hasItems(expectedIndices));
|
||||
assertThat(request.indices(), arrayContainingInAnyOrder(expectedIndices));
|
||||
}
|
||||
{
|
||||
DeleteIndexRequest request = new DeleteIndexRequest("*");
|
||||
Set<String> indices = defaultIndicesResolver.resolve(request, metaData, buildAuthorizedIndices(user, DeleteIndexAction.NAME));
|
||||
String[] expectedIndices = new String[]{"bar", "bar-closed", "foofoo", "foofoo-closed"};
|
||||
assertThat(indices.size(), equalTo(expectedIndices.length));
|
||||
assertThat(indices, hasItems(expectedIndices));
|
||||
assertThat(request.indices(), arrayContainingInAnyOrder(expectedIndices));
|
||||
}
|
||||
}
|
||||
|
||||
public void testIndicesExists() {
|
||||
//verify that the ignore_unavailable and allow_no_indices get replaced like es core does, to make sure that
|
||||
|
Loading…
x
Reference in New Issue
Block a user