From 16f2de017db02a5d0c73ab944416ef439004e226 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Tue, 11 Jul 2017 11:42:32 +0200 Subject: [PATCH] Trivial refactorings after elastic/elasticsearch#25627 Original commit: elastic/x-pack-elasticsearch@1cb9c2f959e02001aab3d464d0a60072001853a4 --- .../xpack/watcher/condition/CompareConditionSearchTests.java | 3 +-- .../xpack/watcher/condition/ScriptConditionSearchTests.java | 3 +-- .../xpack/watcher/execution/TriggeredWatchStoreTests.java | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/plugin/src/test/java/org/elasticsearch/xpack/watcher/condition/CompareConditionSearchTests.java b/plugin/src/test/java/org/elasticsearch/xpack/watcher/condition/CompareConditionSearchTests.java index e1a2f4a8225..d457c948cc7 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/watcher/condition/CompareConditionSearchTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/watcher/condition/CompareConditionSearchTests.java @@ -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); diff --git a/plugin/src/test/java/org/elasticsearch/xpack/watcher/condition/ScriptConditionSearchTests.java b/plugin/src/test/java/org/elasticsearch/xpack/watcher/condition/ScriptConditionSearchTests.java index b07bc79b222..cc5c8ba7522 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/watcher/condition/ScriptConditionSearchTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/watcher/condition/ScriptConditionSearchTests.java @@ -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); diff --git a/plugin/src/test/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStoreTests.java b/plugin/src/test/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStoreTests.java index cfb470518dd..e4a03bdcd77 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStoreTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStoreTests.java @@ -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(