diff options
author | Martin Polden <mpolden@mpolden.no> | 2018-04-19 10:47:52 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2018-04-19 15:05:00 +0200 |
commit | 5dc7c835d796f32bb2c9e0079693dd5da833635f (patch) | |
tree | 07161759a2973c43641500b2e38c8879dfcef126 /controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence | |
parent | 3991eda2b969053748350b3a745b31d391f6917b (diff) |
Decide controller version across all controllers
Diffstat (limited to 'controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence')
-rw-r--r-- | controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/VersionStatusSerializerTest.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/VersionStatusSerializerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/VersionStatusSerializerTest.java index 05b671baea0..b0306178ae3 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/VersionStatusSerializerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/VersionStatusSerializerTest.java @@ -1,8 +1,9 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.persistence; import com.yahoo.component.Version; import com.yahoo.config.provision.ApplicationId; +import com.yahoo.config.provision.HostName; import com.yahoo.vespa.hosted.controller.versions.DeploymentStatistics; import com.yahoo.vespa.hosted.controller.versions.VersionStatus; import com.yahoo.vespa.hosted.controller.versions.VespaVersion; @@ -12,6 +13,7 @@ import java.time.Instant; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.stream.Collectors; import static org.junit.Assert.assertEquals; @@ -31,10 +33,10 @@ public class VersionStatusSerializerTest { Arrays.asList(ApplicationId.from("tenant1", "failing1", "default"), ApplicationId.from("tenant2", "success2", "default")) ); - vespaVersions.add(new VespaVersion(statistics, "dead", Instant.now(), false, - Arrays.asList("cfg1", "cfg2", "cfg3"), VespaVersion.Confidence.normal)); - vespaVersions.add(new VespaVersion(statistics, "cafe", Instant.now(), true, - Arrays.asList("cfg1", "cfg2", "cfg3"), VespaVersion.Confidence.normal)); + vespaVersions.add(new VespaVersion(statistics, "dead", Instant.now(), false, false, + asHostnames("cfg1", "cfg2", "cfg3"), VespaVersion.Confidence.normal)); + vespaVersions.add(new VespaVersion(statistics, "cafe", Instant.now(), true, true, + asHostnames("cfg1", "cfg2", "cfg3"), VespaVersion.Confidence.normal)); VersionStatus status = new VersionStatus(vespaVersions); VersionStatusSerializer serializer = new VersionStatusSerializer(); VersionStatus deserialized = serializer.fromSlime(serializer.toSlime(status)); @@ -45,7 +47,8 @@ public class VersionStatusSerializerTest { VespaVersion b = deserialized.versions().get(i); assertEquals(a.releaseCommit(), b.releaseCommit()); assertEquals(a.committedAt(), b.committedAt()); - assertEquals(a.isCurrentSystemVersion(), b.isCurrentSystemVersion()); + assertEquals(a.isControllerVersion(), b.isControllerVersion()); + assertEquals(a.isSystemVersion(), b.isSystemVersion()); assertEquals(a.statistics(), b.statistics()); assertEquals(a.configServerHostnames(), b.configServerHostnames()); assertEquals(a.confidence(), b.confidence()); @@ -53,4 +56,8 @@ public class VersionStatusSerializerTest { } + private static List<HostName> asHostnames(String... hostname) { + return Arrays.stream(hostname).map(HostName::from).collect(Collectors.toList()); + } + } |