diff options
author | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-06-12 13:52:01 +0200 |
---|---|---|
committer | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-06-12 13:58:51 +0200 |
commit | 5a742d376f0668ad18d0bf443299d9a4a646d10d (patch) | |
tree | decb1e06b4a801288bbd11f3b0badfccc3694ceb /controller-server | |
parent | 5179be6d7834daa9e4b054a27f31858be9e864d7 (diff) |
Sort on zone to ensure consistent order in unit test
Diffstat (limited to 'controller-server')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java index c42363033aa..005e1a4cd01 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java @@ -88,6 +88,7 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.Set; +import java.util.TreeMap; import java.util.function.Consumer; import java.util.function.Predicate; import java.util.logging.Level; @@ -569,10 +570,10 @@ public class ApplicationController { /** Returns all zone-specific cluster endpoints for the given application, in the given zones. */ public Map<ZoneId, Map<ClusterSpec.Id, URI>> clusterEndpoints(ApplicationId id, Collection<ZoneId> zones) { - Map<ZoneId, Map<ClusterSpec.Id, URI>> deployments = new HashMap<>(); + Map<ZoneId, Map<ClusterSpec.Id, URI>> deployments = new TreeMap<>(Comparator.comparing(ZoneId::value)); for (ZoneId zone : zones) clusterEndpoints(new DeploymentId(id, zone)).ifPresent(endpoints -> deployments.put(zone, endpoints)); - return Map.copyOf(deployments); + return Collections.unmodifiableMap(deployments); } /** |