[TEST] adapt test: delete index doesn't resolve to aliases anymore (elastic/x-pack-elasticsearch#1735)
Original commit: elastic/x-pack-elasticsearch@49629ccea64700cec75d61e667534a19178e0db3
@@ -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() {
+ {
+ RefreshRequest request = new RefreshRequest("*");
+ Set<String> indices = defaultIndicesResolver.resolve(request, metaData, buildAuthorizedIndices(user, DeleteIndexAction.NAME));
+ 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", "foofoobar", "foofoo", "foofoo-closed"};
+ 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
