aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/search
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2021-10-10 11:25:02 +0200
committerJon Bratseth <bratseth@gmail.com>2021-10-10 11:25:02 +0200
commit27bcc7e03be01b200654254af59a20566567ca33 (patch)
tree63eab384dc0e9027eeab38ceaf487e25a61c25ed /container-search/src/test/java/com/yahoo/search
parent165142127b8d40621fdd29a2fcac74084eeb4d9c (diff)
Guarantee we always have an executor
Diffstat (limited to 'container-search/src/test/java/com/yahoo/search')
-rw-r--r--container-search/src/test/java/com/yahoo/search/searchers/ValidateNearestNeighborTestCase.java6
-rw-r--r--container-search/src/test/java/com/yahoo/search/searchers/test/ValidateMatchPhaseSearcherTestCase.java6
2 files changed, 6 insertions, 6 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/searchers/ValidateNearestNeighborTestCase.java b/container-search/src/test/java/com/yahoo/search/searchers/ValidateNearestNeighborTestCase.java
index 63a05e6e2d8..71b46e8235c 100644
--- a/container-search/src/test/java/com/yahoo/search/searchers/ValidateNearestNeighborTestCase.java
+++ b/container-search/src/test/java/com/yahoo/search/searchers/ValidateNearestNeighborTestCase.java
@@ -1,8 +1,6 @@
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchers;
-import com.google.common.util.concurrent.MoreExecutors;
-
import com.yahoo.config.subscription.ConfigGetter;
import com.yahoo.config.subscription.RawSource;
import com.yahoo.language.simple.SimpleLinguistics;
@@ -232,7 +230,9 @@ public class ValidateNearestNeighborTestCase {
query.getRanking().getFeatures().put("query(qvector)", qTensor);
SearchDefinition searchDefinition = new SearchDefinition("document");
IndexFacts indexFacts = new IndexFacts(new IndexModel(searchDefinition));
- Execution.Context context = new Execution.Context(null, indexFacts, null, new RendererRegistry(MoreExecutors.directExecutor()), new SimpleLinguistics(), null);
+ Execution.Context context = new Execution.Context(null, indexFacts, null,
+ new RendererRegistry(Runnable::run),
+ new SimpleLinguistics(), Runnable::run);
return new Execution(searcher, context).search(query);
}
diff --git a/container-search/src/test/java/com/yahoo/search/searchers/test/ValidateMatchPhaseSearcherTestCase.java b/container-search/src/test/java/com/yahoo/search/searchers/test/ValidateMatchPhaseSearcherTestCase.java
index 880140aba23..8ecd823f371 100644
--- a/container-search/src/test/java/com/yahoo/search/searchers/test/ValidateMatchPhaseSearcherTestCase.java
+++ b/container-search/src/test/java/com/yahoo/search/searchers/test/ValidateMatchPhaseSearcherTestCase.java
@@ -1,11 +1,9 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchers.test;
-import com.google.common.util.concurrent.MoreExecutors;
import com.yahoo.component.chain.Chain;
import com.yahoo.config.subscription.ConfigGetter;
import com.yahoo.config.subscription.RawSource;
-import com.yahoo.language.Linguistics;
import com.yahoo.language.simple.SimpleLinguistics;
import com.yahoo.search.Searcher;
import com.yahoo.search.rendering.RendererRegistry;
@@ -108,7 +106,9 @@ public class ValidateMatchPhaseSearcherTestCase {
}
private Execution createExecution(Searcher searcher) {
- Execution.Context context = new Execution.Context(null, null, null, new RendererRegistry(MoreExecutors.directExecutor()), new SimpleLinguistics(), null);
+ Execution.Context context = new Execution.Context(null, null, null,
+ new RendererRegistry(Runnable::run),
+ new SimpleLinguistics(), Runnable::run);
return new Execution(chainedAsSearchChain(searcher), context);
}