diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-10-18 12:45:33 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2018-10-18 12:45:33 +0200 |
commit | ff5425a5ced4134efcf8682c04d546e89bbe770e (patch) | |
tree | 493b20ea1082cd23f74195bb5b0aa4c2866ec72a /config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecTest.java | |
parent | 0a5aeca4ccd596256bb1ee9265857499440de0a4 (diff) |
Don't upgrade if major version i pinned
Add major-version to deployment as that makes it
available to deployment orchestration.
Diffstat (limited to 'config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecTest.java')
-rw-r--r-- | config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecTest.java b/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecTest.java index 103724744de..a0423293d1d 100644 --- a/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecTest.java +++ b/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecTest.java @@ -30,6 +30,7 @@ public class DeploymentSpecTest { DeploymentSpec spec = DeploymentSpec.fromXml(r); assertEquals(specXml, spec.xmlForm()); assertEquals(1, spec.steps().size()); + assertFalse(spec.majorVersion().isPresent()); assertTrue(spec.steps().get(0).deploysTo(Environment.test)); assertTrue(spec.includes(Environment.test, Optional.empty())); assertFalse(spec.includes(Environment.test, Optional.of(RegionName.from("region1")))); @@ -39,6 +40,20 @@ public class DeploymentSpecTest { } @Test + public void testSpecPinningMajorVersion() { + String specXml = "<deployment version='1.0' major-version='6'>" + + " <test/>" + + "</deployment>"; + + StringReader r = new StringReader(specXml); + DeploymentSpec spec = DeploymentSpec.fromXml(r); + assertEquals(specXml, spec.xmlForm()); + assertEquals(1, spec.steps().size()); + assertTrue(spec.majorVersion().isPresent()); + assertEquals(6, (int)spec.majorVersion().get()); + } + + @Test public void stagingSpec() { StringReader r = new StringReader( "<deployment version='1.0'>" + |