|
@@ -5,6 +5,10 @@
|
|
|
*/
|
|
|
package org.elasticsearch.xpack.search;
|
|
|
|
|
|
+import org.elasticsearch.action.admin.indices.get.GetIndexRequest;
|
|
|
+import org.elasticsearch.action.admin.indices.get.GetIndexResponse;
|
|
|
+import org.elasticsearch.action.support.PlainActionFuture;
|
|
|
+import org.elasticsearch.cluster.metadata.IndexMetaData;
|
|
|
import org.elasticsearch.cluster.service.ClusterService;
|
|
|
import org.elasticsearch.common.settings.Settings;
|
|
|
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
|
@@ -17,6 +21,7 @@ import org.junit.Before;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.util.Collections;
|
|
|
+import java.util.concurrent.ExecutionException;
|
|
|
|
|
|
import static org.elasticsearch.xpack.search.AsyncSearchResponseTests.assertEqualResponses;
|
|
|
import static org.elasticsearch.xpack.search.AsyncSearchResponseTests.randomAsyncSearchResponse;
|
|
@@ -100,4 +105,15 @@ public class AsyncSearchIndexServiceTests extends ESSingleNodeTestCase {
|
|
|
assertFalse(indexService.ensureAuthenticatedUserIsSame(original, runAsDiffType));
|
|
|
assertFalse(indexService.ensureAuthenticatedUserIsSame(threadContext.getHeaders(), runAsDiffType));
|
|
|
}
|
|
|
+
|
|
|
+ public void testSettings() throws ExecutionException, InterruptedException {
|
|
|
+ PlainActionFuture<Void> future = PlainActionFuture.newFuture();
|
|
|
+ indexService.createIndexIfNecessary(future);
|
|
|
+ future.get();
|
|
|
+ GetIndexResponse getIndexResponse = client().admin().indices().getIndex(
|
|
|
+ new GetIndexRequest().indices(AsyncSearchIndexService.INDEX)).actionGet();
|
|
|
+ Settings settings = getIndexResponse.getSettings().get(AsyncSearchIndexService.INDEX);
|
|
|
+ assertEquals("1", settings.get(IndexMetaData.SETTING_NUMBER_OF_SHARDS));
|
|
|
+ assertEquals("0-1", settings.get(IndexMetaData.SETTING_AUTO_EXPAND_REPLICAS));
|
|
|
+ }
|
|
|
}
|