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@0ffcf0c5ff
This commit is contained in:
Martijn van Groningen 2015-09-07 18:34:44 +02:00
parent 06ec935a08
commit a65d1e3d58
2 changed files with 6 additions and 2 deletions

View File

@ -49,6 +49,10 @@ public class TimeThrottleIntegrationTests extends AbstractWatcherIntegrationTest
return eventIndexResponse; return eventIndexResponse;
} }
@Override
protected boolean enableShield() {
return false;
}
@Test @Test

View File

@ -255,11 +255,11 @@ public abstract class AbstractWatcherIntegrationTestCase extends ESIntegTestCase
} }
protected long docCount(String index, String type, SearchSourceBuilder source) { 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) { if (type != null) {
builder.setTypes(type); builder.setTypes(type);
} }
builder.setSource(source.buildAsBytes());
return builder.get().getHits().getTotalHits(); return builder.get().getHits().getTotalHits();
} }