From 287f4da0b999d4645c63af21eb0b47e7bf3b88a8 Mon Sep 17 00:00:00 2001 From: Ali Beyad Date: Tue, 19 Jul 2016 14:15:47 -0400 Subject: [PATCH] Fix tests that use write consistency level in favor of ActiveShardCount Original commit: elastic/x-pack-elasticsearch@4c463c8d7b80a3fdc6a86e254a4cc7185d54d4ea --- .../watcher/test/integration/BootStrapTests.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java index 1b8665300da..263b7fab2e1 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java @@ -5,9 +5,9 @@ */ package org.elasticsearch.xpack.watcher.test.integration; -import org.elasticsearch.action.WriteConsistencyLevel; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.test.junit.annotations.TestLogging; @@ -140,7 +140,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase { .startObject("none").endObject() .endObject() .endObject()) - .setConsistencyLevel(WriteConsistencyLevel.ALL) + .setWaitForActiveShards(ActiveShardCount.ALL) .setRefreshPolicy(IMMEDIATE) .get(); @@ -158,7 +158,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase { .startObject("none").endObject() .endObject() .endObject()) - .setConsistencyLevel(WriteConsistencyLevel.ALL) + .setWaitForActiveShards(ActiveShardCount.ALL) .setRefreshPolicy(IMMEDIATE) .get(); @@ -176,7 +176,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase { .startObject("none").endObject() .endObject() .endObject()) - .setConsistencyLevel(WriteConsistencyLevel.ALL) + .setWaitForActiveShards(ActiveShardCount.ALL) .setRefreshPolicy(IMMEDIATE) .get(); @@ -200,7 +200,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase { .field(event.type(), event) .endObject() .endObject()) - .setConsistencyLevel(WriteConsistencyLevel.ALL) + .setWaitForActiveShards(ActiveShardCount.ALL) .setRefreshPolicy(IMMEDIATE) .get(); @@ -226,7 +226,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase { .condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1L)) .buildAsBytes(XContentType.JSON) ) - .setConsistencyLevel(WriteConsistencyLevel.ALL) + .setWaitForActiveShards(ActiveShardCount.ALL) .get(); } @@ -269,7 +269,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase { TriggeredWatch triggeredWatch = new TriggeredWatch(wid, event); client().prepareIndex(TriggeredWatchStore.INDEX_NAME, TriggeredWatchStore.DOC_TYPE, triggeredWatch.id().value()) .setSource(jsonBuilder().value(triggeredWatch)) - .setConsistencyLevel(WriteConsistencyLevel.ALL) + .setWaitForActiveShards(ActiveShardCount.ALL) .get(); } @@ -320,7 +320,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase { TriggeredWatch triggeredWatch = new TriggeredWatch(wid, event); client().prepareIndex(TriggeredWatchStore.INDEX_NAME, TriggeredWatchStore.DOC_TYPE, triggeredWatch.id().value()) .setSource(jsonBuilder().value(triggeredWatch)) - .setConsistencyLevel(WriteConsistencyLevel.ALL) + .setWaitForActiveShards(ActiveShardCount.ALL) .get(); }