summaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-11-09 06:39:16 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2022-11-09 06:39:16 +0100
commit32bdef6ad0ea47a706c051606a2c75a9e35ecac6 (patch)
tree1a28f4d50b905df0ccd59498b130bfa4312f71ae /container-search/src/test/java/com
parente51cc7dbac082119b5d0003f2161a0777fb3c321 (diff)
Reduce 'raw' warnings
Diffstat (limited to 'container-search/src/test/java/com')
-rw-r--r--container-search/src/test/java/com/yahoo/search/dispatch/DispatcherTest.java27
1 files changed, 17 insertions, 10 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/dispatch/DispatcherTest.java b/container-search/src/test/java/com/yahoo/search/dispatch/DispatcherTest.java
index b9c724a6e26..a6c07b74a92 100644
--- a/container-search/src/test/java/com/yahoo/search/dispatch/DispatcherTest.java
+++ b/container-search/src/test/java/com/yahoo/search/dispatch/DispatcherTest.java
@@ -16,7 +16,11 @@ import java.util.List;
import java.util.Optional;
import static com.yahoo.search.dispatch.MockSearchCluster.createDispatchConfig;
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
/**
* @author ollivir
@@ -33,8 +37,9 @@ public class DispatcherTest {
assertEquals(1, nodes.get(0).key());
return true;
});
- Dispatcher disp = new Dispatcher(new ClusterMonitor(cl, false), cl, createDispatchConfig(), invokerFactory);
+ Dispatcher disp = new Dispatcher(new ClusterMonitor<>(cl, false), cl, createDispatchConfig(), invokerFactory);
SearchInvoker invoker = disp.getSearchInvoker(q, null);
+ assertNotNull(invoker);
invokerFactory.verifyAllEventsProcessed();
disp.deconstruct();
}
@@ -48,8 +53,9 @@ public class DispatcherTest {
}
};
MockInvokerFactory invokerFactory = new MockInvokerFactory(cl, (n, a) -> true);
- Dispatcher disp = new Dispatcher(new ClusterMonitor(cl, false), cl, createDispatchConfig(), invokerFactory);
+ Dispatcher disp = new Dispatcher(new ClusterMonitor<>(cl, false), cl, createDispatchConfig(), invokerFactory);
SearchInvoker invoker = disp.getSearchInvoker(new Query(), null);
+ assertNotNull(invoker);
invokerFactory.verifyAllEventsProcessed();
disp.deconstruct();
}
@@ -65,8 +71,9 @@ public class DispatcherTest {
assertTrue(acceptIncompleteCoverage);
return true;
});
- Dispatcher disp = new Dispatcher(new ClusterMonitor(cl, false), cl, createDispatchConfig(), invokerFactory);
+ Dispatcher disp = new Dispatcher(new ClusterMonitor<>(cl, false), cl, createDispatchConfig(), invokerFactory);
SearchInvoker invoker = disp.getSearchInvoker(new Query(), null);
+ assertNotNull(invoker);
invokerFactory.verifyAllEventsProcessed();
disp.deconstruct();
}
@@ -77,7 +84,7 @@ public class DispatcherTest {
SearchCluster cl = new MockSearchCluster("1", 2, 1);
MockInvokerFactory invokerFactory = new MockInvokerFactory(cl, (n, a) -> false, (n, a) -> false);
- Dispatcher disp = new Dispatcher(new ClusterMonitor(cl, false), cl, createDispatchConfig(), invokerFactory);
+ Dispatcher disp = new Dispatcher(new ClusterMonitor<>(cl, false), cl, createDispatchConfig(), invokerFactory);
disp.getSearchInvoker(new Query(), null);
disp.deconstruct();
fail("Expected exception");
@@ -90,7 +97,7 @@ public class DispatcherTest {
@Test
void testGroup0IsSelected() {
SearchCluster cluster = new MockSearchCluster("1", 3, 1);
- Dispatcher dispatcher = new Dispatcher(new ClusterMonitor(cluster, false), cluster, createDispatchConfig(), new MockInvokerFactory(cluster, (n, a) -> true));
+ Dispatcher dispatcher = new Dispatcher(new ClusterMonitor<>(cluster, false), cluster, createDispatchConfig(), new MockInvokerFactory(cluster, (n, a) -> true));
cluster.pingIterationCompleted();
assertEquals(0,
dispatcher.getSearchInvoker(new Query(), null).distributionKey().get().longValue());
@@ -100,7 +107,7 @@ public class DispatcherTest {
@Test
void testGroup0IsSkippedWhenItIsBlockingFeed() {
SearchCluster cluster = new MockSearchCluster("1", 3, 1);
- Dispatcher dispatcher = new Dispatcher(new ClusterMonitor(cluster, false), cluster, createDispatchConfig(), new MockInvokerFactory(cluster, (n, a) -> true));
+ Dispatcher dispatcher = new Dispatcher(new ClusterMonitor<>(cluster, false), cluster, createDispatchConfig(), new MockInvokerFactory(cluster, (n, a) -> true));
cluster.group(0).get().nodes().get(0).setBlockingWrites(true);
cluster.pingIterationCompleted();
assertEquals(1,
@@ -112,7 +119,7 @@ public class DispatcherTest {
@Test
void testGroup0IsSelectedWhenMoreAreBlockingFeed() {
SearchCluster cluster = new MockSearchCluster("1", 3, 1);
- Dispatcher dispatcher = new Dispatcher(new ClusterMonitor(cluster, false), cluster, createDispatchConfig(), new MockInvokerFactory(cluster, (n, a) -> true));
+ Dispatcher dispatcher = new Dispatcher(new ClusterMonitor<>(cluster, false), cluster, createDispatchConfig(), new MockInvokerFactory(cluster, (n, a) -> true));
cluster.group(0).get().nodes().get(0).setBlockingWrites(true);
cluster.group(1).get().nodes().get(0).setBlockingWrites(true);
cluster.pingIterationCompleted();
@@ -125,7 +132,7 @@ public class DispatcherTest {
@Test
void testGroup0IsSelectedWhenItIsBlockingFeedWhenNoOthers() {
SearchCluster cluster = new MockSearchCluster("1", 1, 1);
- Dispatcher dispatcher = new Dispatcher(new ClusterMonitor(cluster, false), cluster, createDispatchConfig(), new MockInvokerFactory(cluster, (n, a) -> true));
+ Dispatcher dispatcher = new Dispatcher(new ClusterMonitor<>(cluster, false), cluster, createDispatchConfig(), new MockInvokerFactory(cluster, (n, a) -> true));
cluster.group(0).get().nodes().get(0).setBlockingWrites(true);
cluster.pingIterationCompleted();
assertEquals(0,
@@ -176,7 +183,7 @@ public class DispatcherTest {
int maxHitsPerNode,
Node node) {
fail("Unexpected call to createNodeSearchInvoker");
- return null;
+ return Optional.empty();
}
@Override