Trivial refactorings after elastic/elasticsearch#25627

Original commit: elastic/x-pack-elasticsearch@1cb9c2f959
This commit is contained in:
Simon Willnauer 2017-07-11 11:42:32 +02:00
parent 261d65a9c4
commit 16f2de017d
3 changed files with 4 additions and 6 deletions

View File

@ -13,7 +13,6 @@ import org.elasticsearch.search.SearchShardTarget;
import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.BucketOrder;
import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval;
import org.elasticsearch.search.aggregations.bucket.histogram.Histogram;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;
import org.elasticsearch.search.internal.InternalSearchResponse;
@ -81,7 +80,7 @@ public class CompareConditionSearchTests extends AbstractWatcherIntegrationTestC
Clock.systemUTC());
SearchHit hit = new SearchHit(0, "1", new Text("type"), null);
hit.score(1f);
hit.shard(new SearchShardTarget("a", new Index("a", "indexUUID"), 0));
hit.shard(new SearchShardTarget("a", new Index("a", "indexUUID"), 0, null));
InternalSearchResponse internalSearchResponse = new InternalSearchResponse(
new SearchHits(new SearchHit[]{hit}, 1L, 1f), null, null, null, false, false, 1);

View File

@ -19,7 +19,6 @@ import org.elasticsearch.search.SearchShardTarget;
import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.BucketOrder;
import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval;
import org.elasticsearch.search.aggregations.bucket.histogram.Histogram;
import org.elasticsearch.search.internal.InternalSearchResponse;
import org.elasticsearch.xpack.watcher.execution.WatchExecutionContext;
import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase;
@ -104,7 +103,7 @@ public class ScriptConditionSearchTests extends AbstractWatcherIntegrationTestCa
mockScript("ctx.payload.hits?.hits[0]?._score == 1.0"), scriptService);
SearchHit hit = new SearchHit(0, "1", new Text("type"), null);
hit.score(1f);
hit.shard(new SearchShardTarget("a", new Index("a", "testUUID"), 0));
hit.shard(new SearchShardTarget("a", new Index("a", "testUUID"), 0, null));
InternalSearchResponse internalSearchResponse = new InternalSearchResponse(new SearchHits(
new SearchHit[]{hit}, 1L, 1f), null, null, null, false, false, 1);

View File

@ -180,7 +180,7 @@ public class TriggeredWatchStoreTests extends ESTestCase {
BytesArray source = new BytesArray("{}");
SearchHit hit = new SearchHit(0, "first_foo", new Text(TriggeredWatchStore.DOC_TYPE), null);
hit.version(1L);
hit.shard(new SearchShardTarget("_node_id", index, 0));
hit.shard(new SearchShardTarget("_node_id", index, 0, null));
hit.sourceRef(source);
SearchHits hits = new SearchHits(new SearchHit[]{hit}, 1, 1.0f);
when(searchResponse1.getHits()).thenReturn(hits);
@ -192,7 +192,7 @@ public class TriggeredWatchStoreTests extends ESTestCase {
// First return a scroll response with a single hit and then with no hits
hit = new SearchHit(0, "second_foo", new Text(TriggeredWatchStore.DOC_TYPE), null);
hit.version(1L);
hit.shard(new SearchShardTarget("_node_id", index, 0));
hit.shard(new SearchShardTarget("_node_id", index, 0, null));
hit.sourceRef(source);
hits = new SearchHits(new SearchHit[]{hit}, 1, 1.0f);
SearchResponse searchResponse2 = new SearchResponse(