diff options
author | Harald Musum <musum@yahooinc.com> | 2021-10-07 13:15:48 +0200 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2021-10-07 13:15:48 +0200 |
commit | 35cc39659cd8acefcee399a1fc2a5228dd38adc5 (patch) | |
tree | f740e3c2d2bc653f2dee1afd396a8b86d132cd1a /config/src/test | |
parent | 03224ae1749a058c88ee926738195ae0d3204322 (diff) |
Reuse supervisor when we have one
Remove unnecessary constructor
Diffstat (limited to 'config/src/test')
-rw-r--r-- | config/src/test/java/com/yahoo/vespa/config/JRTConnectionPoolTest.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/config/src/test/java/com/yahoo/vespa/config/JRTConnectionPoolTest.java b/config/src/test/java/com/yahoo/vespa/config/JRTConnectionPoolTest.java index 5c0876a2649..43f9a87454d 100644 --- a/config/src/test/java/com/yahoo/vespa/config/JRTConnectionPoolTest.java +++ b/config/src/test/java/com/yahoo/vespa/config/JRTConnectionPoolTest.java @@ -5,7 +5,6 @@ import com.yahoo.config.subscription.ConfigSourceSet; import org.junit.Test; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; @@ -27,7 +26,8 @@ import static org.junit.Assert.assertTrue; * @author hmusum */ public class JRTConnectionPoolTest { - private static final List<String> sources = new ArrayList<>((Arrays.asList("host0", "host1", "host2"))); + + private static final ConfigSourceSet sources = new ConfigSourceSet(List.of("host0", "host1", "host2")); @Test public void test_random_selection_of_source() { @@ -57,7 +57,7 @@ public class JRTConnectionPoolTest { public void testManySources() { Map<String, Integer> timesUsed = new LinkedHashMap<>(); - List<String> twoSources = List.of("host0", "host1"); + ConfigSourceSet twoSources = new ConfigSourceSet(List.of("host0", "host1")); JRTConnectionPool sourcePool = new JRTConnectionPool(twoSources); int count = 1000; @@ -93,8 +93,7 @@ public class JRTConnectionPoolTest { */ @Test public void updateSources() { - List<String> twoSources = List.of("host0", "host1"); - + ConfigSourceSet twoSources = new ConfigSourceSet(List.of("host0", "host1")); JRTConnectionPool sourcePool = new JRTConnectionPool(twoSources); ConfigSourceSet sourcesBefore = sourcePool.getSourceSet(); @@ -130,7 +129,7 @@ public class JRTConnectionPoolTest { @Test public void testFailingSources() { - List<String> sources = List.of("host0", "host1", "host2"); + ConfigSourceSet sources = new ConfigSourceSet(List.of("host0", "host1")); JRTConnectionPool connectionPool = new JRTConnectionPool(sources); Connection firstConnection = connectionPool.getCurrent(); |