summaryrefslogtreecommitdiffstats
path: root/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecTest.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2017-10-11 13:35:06 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2017-10-11 13:35:06 +0200
commit138b462ab7b56ab2acf53959533a472ea187be76 (patch)
tree8ec339dd6a1077647d08b367fea8f1e517b631e2 /config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecTest.java
parentfc7e562c164665378e7f64212f30d8225eb48312 (diff)
Enforce order of block-change
Enforce that the block-change tag is placed after any test and staging tag and before the prod tag. This is in case we want to allow multiple block points in the future (perhaps to block rolling out to the next instance when having multiple instances) such that the placement becomes significant.
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.java28
1 files changed, 28 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 943432213ac..fbf685b9d86 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
@@ -309,6 +309,34 @@ public class DeploymentSpecTest {
assertTrue(spec.canUpgradeAt(Instant.parse("2017-09-23T10:15:30.00Z")));
}
+ @Test(expected = IllegalArgumentException.class)
+ public void deploymentSpecWithIllegallyOrderedDeploymentSpec1() {
+ StringReader r = new StringReader(
+ "<deployment>\n" +
+ " <block-change days='sat' hours='10' time-zone='CET'/>\n" +
+ " <prod>\n" +
+ " <region active='true'>us-west-1</region>\n" +
+ " </prod>\n" +
+ " <block-change days='mon,tue' hours='15-16'/>\n" +
+ "</deployment>"
+ );
+ DeploymentSpec spec = DeploymentSpec.fromXml(r);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void deploymentSpecWithIllegallyOrderedDeploymentSpec2() {
+ StringReader r = new StringReader(
+ "<deployment>\n" +
+ " <block-change days='sat' hours='10' time-zone='CET'/>\n" +
+ " <test/>\n" +
+ " <prod>\n" +
+ " <region active='true'>us-west-1</region>\n" +
+ " </prod>\n" +
+ "</deployment>"
+ );
+ DeploymentSpec spec = DeploymentSpec.fromXml(r);
+ }
+
@Test
public void deploymentSpecWithChangeBlocker() {
StringReader r = new StringReader(