From 4517892951feaafcacfdc56ba7c4a1492d0b4cfd Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Tue, 6 Jun 2017 20:50:16 -0400 Subject: [PATCH] Remove uses of unnecessary callback interface This commit removes uses of a callback interface that is unnecessary in core as we can use java.util.function.Consumer instead. Relates elastic/x-pack-elasticsearch#1654 Original commit: elastic/x-pack-elasticsearch@21f470e97400e2a9ccfb2909bb473fcc55511869 --- .../watcher/test/AbstractWatcherIntegrationTestCase.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugin/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java b/plugin/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java index 9435f34f50a..4d70888a5b8 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java @@ -27,8 +27,6 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.Callback; -import org.elasticsearch.common.util.iterable.Iterables; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; @@ -97,6 +95,7 @@ import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Consumer; import java.util.function.Function; import java.util.stream.Collectors; @@ -476,10 +475,10 @@ public abstract class AbstractWatcherIntegrationTestCase extends ESIntegTestCase } } - protected SearchResponse searchWatchRecords(Callback requestBuilderCallback) { + protected SearchResponse searchWatchRecords(Consumer requestBuilderCallback) { SearchRequestBuilder builder = client().prepareSearch(HistoryStore.INDEX_PREFIX_WITH_TEMPLATE + "*").setTypes(HistoryStore.DOC_TYPE); - requestBuilderCallback.handle(builder); + requestBuilderCallback.accept(builder); return builder.get(); }