summaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/prelude/querytransform/test
diff options
context:
space:
mode:
Diffstat (limited to 'container-search/src/test/java/com/yahoo/prelude/querytransform/test')
-rw-r--r--container-search/src/test/java/com/yahoo/prelude/querytransform/test/LiteralBoostSearcherTestCase.java12
-rw-r--r--container-search/src/test/java/com/yahoo/prelude/querytransform/test/NormalizingSearcherTestCase.java16
2 files changed, 12 insertions, 16 deletions
diff --git a/container-search/src/test/java/com/yahoo/prelude/querytransform/test/LiteralBoostSearcherTestCase.java b/container-search/src/test/java/com/yahoo/prelude/querytransform/test/LiteralBoostSearcherTestCase.java
index 16e27303fa8..5f9d0a53f06 100644
--- a/container-search/src/test/java/com/yahoo/prelude/querytransform/test/LiteralBoostSearcherTestCase.java
+++ b/container-search/src/test/java/com/yahoo/prelude/querytransform/test/LiteralBoostSearcherTestCase.java
@@ -1,7 +1,6 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.prelude.querytransform.test;
-import com.google.common.collect.ImmutableList;
import com.yahoo.prelude.Index;
import com.yahoo.prelude.IndexFacts;
import com.yahoo.prelude.IndexModel;
@@ -12,7 +11,10 @@ import com.yahoo.search.searchchain.Execution;
import com.yahoo.search.test.QueryTestCase;
import org.junit.jupiter.api.Test;
-import java.util.*;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -83,9 +85,9 @@ public class LiteralBoostSearcherTestCase {
private IndexFacts createIndexFacts() {
Map<String, List<String>> clusters = new LinkedHashMap<>();
- clusters.put("cluster1", Arrays.asList("type1", "type2", "type3"));
- clusters.put("cluster2", Arrays.asList("type4", "type5"));
- Collection<SearchDefinition> searchDefs = ImmutableList.of(
+ clusters.put("cluster1", List.of("type1", "type2", "type3"));
+ clusters.put("cluster2", List.of("type4", "type5"));
+ Collection<SearchDefinition> searchDefs = List.of(
createSearchDefinitionWithFields("type1", true),
createSearchDefinitionWithFields("type2", false),
new SearchDefinition("type3"),
diff --git a/container-search/src/test/java/com/yahoo/prelude/querytransform/test/NormalizingSearcherTestCase.java b/container-search/src/test/java/com/yahoo/prelude/querytransform/test/NormalizingSearcherTestCase.java
index 239f4500297..9eba23e3ab6 100644
--- a/container-search/src/test/java/com/yahoo/prelude/querytransform/test/NormalizingSearcherTestCase.java
+++ b/container-search/src/test/java/com/yahoo/prelude/querytransform/test/NormalizingSearcherTestCase.java
@@ -4,7 +4,6 @@ package com.yahoo.prelude.querytransform.test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
-import com.google.common.collect.ImmutableList;
import com.yahoo.language.Linguistics;
import com.yahoo.language.simple.SimpleLinguistics;
import com.yahoo.prelude.Index;
@@ -23,8 +22,8 @@ import org.junit.jupiter.api.Test;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
@@ -73,12 +72,7 @@ public class NormalizingSearcherTestCase {
}
private String enc(String s) {
- try {
- return URLEncoder.encode(s, "utf-8");
- }
- catch (UnsupportedEncodingException e) {
- throw new RuntimeException(e);
- }
+ return URLEncoder.encode(s, StandardCharsets.UTF_8);
}
@Test
@@ -129,9 +123,9 @@ public class NormalizingSearcherTestCase {
private IndexFacts createIndexFacts() {
Map<String, List<String>> clusters = new LinkedHashMap<>();
- clusters.put("cluster1", Arrays.asList("type1", "type2", "type3"));
- clusters.put("cluster2", Arrays.asList("type4", "type5"));
- Collection<SearchDefinition> searchDefs = ImmutableList.of(
+ clusters.put("cluster1", List.of("type1", "type2", "type3"));
+ clusters.put("cluster2", List.of("type4", "type5"));
+ Collection<SearchDefinition> searchDefs = List.of(
createSearchDefinitionWithFields("type1", true),
createSearchDefinitionWithFields("type2", false),
new SearchDefinition("type3"),