From a65d1e3d58b35f5b539b736d54d8bcf03d6533cf Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 7 Sep 2015 18:34:44 +0200 Subject: [PATCH] test: fix docCount to only use the source builder in SearchRequestBuilder and don't use also the source on SearchRequest Original commit: elastic/x-pack-elasticsearch@0ffcf0c5fff40d74e98c7e42dfb8cf9ac5689f67 --- .../watcher/actions/TimeThrottleIntegrationTests.java | 4 ++++ .../watcher/test/AbstractWatcherIntegrationTestCase.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/TimeThrottleIntegrationTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/TimeThrottleIntegrationTests.java index 71c92166136..041dce8559e 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/TimeThrottleIntegrationTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/TimeThrottleIntegrationTests.java @@ -49,6 +49,10 @@ public class TimeThrottleIntegrationTests extends AbstractWatcherIntegrationTest return eventIndexResponse; } + @Override + protected boolean enableShield() { + return false; + } @Test diff --git a/watcher/src/test/java/org/elasticsearch/watcher/test/AbstractWatcherIntegrationTestCase.java b/watcher/src/test/java/org/elasticsearch/watcher/test/AbstractWatcherIntegrationTestCase.java index 32ee5d8d37c..f64916b3021 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/test/AbstractWatcherIntegrationTestCase.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/test/AbstractWatcherIntegrationTestCase.java @@ -255,11 +255,11 @@ public abstract class AbstractWatcherIntegrationTestCase extends ESIntegTestCase } protected long docCount(String index, String type, SearchSourceBuilder source) { - SearchRequestBuilder builder = client().prepareSearch(index).setSize(0); + SearchRequestBuilder builder = client().prepareSearch(index) + .internalBuilder(source).setSize(0); if (type != null) { builder.setTypes(type); } - builder.setSource(source.buildAsBytes()); return builder.get().getHits().getTotalHits(); }