diff options
author | Harald Musum <musum@verizonmedia.com> | 2020-04-14 08:33:45 +0200 |
---|---|---|
committer | Harald Musum <musum@verizonmedia.com> | 2020-04-14 08:33:45 +0200 |
commit | 92a0e866562662d5be4b3aa01da2a115bc9a2a00 (patch) | |
tree | 655712bebdcf52e51ef440e406fa1a1fbe015450 /config-model/src/test/java/com/yahoo | |
parent | e40c993de0b870a2aec7fff91a64ac229b36fd0b (diff) |
Clean up and simplify FileDistributor
No functional changes
Diffstat (limited to 'config-model/src/test/java/com/yahoo')
2 files changed, 11 insertions, 7 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterUtils.java b/config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterUtils.java index db9153fcf23..b5915ecf033 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterUtils.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/content/utils/ContentClusterUtils.java @@ -60,7 +60,7 @@ public class ContentClusterUtils { public static ContentCluster createCluster(String clusterXml, MockRoot root) { Document doc = XML.getDocument(clusterXml); Admin admin = new Admin(root, new DefaultMonitoring("vespa", 60), new Metrics(), false, - new FileDistributionConfigProducer(root, new MockFileRegistry(), null), + new FileDistributionConfigProducer(root, new MockFileRegistry(), List.of()), root.getDeployState().isHosted()); ConfigModelContext context = ConfigModelContext.create(null, root.getDeployState(), null,null, root, null); diff --git a/config-model/src/test/java/com/yahoo/vespa/model/filedistribution/FileDistributorTestCase.java b/config-model/src/test/java/com/yahoo/vespa/model/filedistribution/FileDistributorTestCase.java index 131a5344116..39ded69b710 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/filedistribution/FileDistributorTestCase.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/filedistribution/FileDistributorTestCase.java @@ -10,31 +10,34 @@ import org.junit.Test; import java.io.File; import java.util.Arrays; import java.util.HashSet; +import java.util.List; import java.util.Set; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertNotNull; /** * @author bratseth */ public class FileDistributorTestCase { + @Test public void fileDistributor() { MockHosts hosts = new MockHosts(); - FileDistributor fileDistributor = new FileDistributor(new MockFileRegistry(), null); + FileDistributor fileDistributor = new FileDistributor(new MockFileRegistry(), List.of()); String file1 = "component/path1"; String file2 = "component/path2"; - FileReference ref1 = fileDistributor.sendFileToHosts(file1, Arrays.asList(hosts.host1, hosts.host2)); - FileReference ref2 = fileDistributor.sendFileToHosts(file2, Arrays.asList(hosts.host3)); + FileReference ref1 = fileDistributor.sendFileToHost(file1, hosts.host1); + fileDistributor.sendFileToHost(file1, hosts.host2); // same file reference as above + FileReference ref2 = fileDistributor.sendFileToHost(file2, hosts.host3); assertEquals(new HashSet<>(Arrays.asList(hosts.host1, hosts.host2, hosts.host3)), fileDistributor.getTargetHosts()); - assertTrue( ref1 != null ); - assertTrue( ref2 != null ); + assertNotNull(ref1); + assertNotNull(ref2); MockFileDistribution dbHandler = new MockFileDistribution(); fileDistributor.sendDeployedFiles(dbHandler); @@ -54,4 +57,5 @@ public class FileDistributorTestCase { return null; } } + } |