diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2017-05-09 10:55:44 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2017-05-09 10:55:44 +0200 |
commit | a85971433732f7bbcf355e2615d1957d4f667e1e (patch) | |
tree | 783aab20f15d8b763995e9e864ad27b58cbb82cb /config-model-api/src/test | |
parent | 20b6883ae868ca9d9e5e7b7050fea3150f30d4e7 (diff) |
Fix wacky tests
Diffstat (limited to 'config-model-api/src/test')
-rw-r--r-- | config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecTest.java | 37 |
1 files changed, 17 insertions, 20 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 919735f91db..f1a9840bd88 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 @@ -138,25 +138,24 @@ public class DeploymentSpecTest { assertEquals(spec.globalServiceId(), Optional.of("query")); } - @Test - public void productionSpecWithInvalidGlobalServiceId() { - for (Environment environment : Environment.values()) { - if (environment.equals(Environment.prod)) continue; + @Test(expected=IllegalArgumentException.class) + public void globalServiceIdInTest() { + StringReader r = new StringReader( + "<deployment version='1.0'>" + + " <test global-service-id='query' />" + + "</deployment>" + ); + DeploymentSpec spec = DeploymentSpec.fromXml(r); + } - StringReader r = new StringReader(String.format( + @Test(expected=IllegalArgumentException.class) + public void globalServiceIdInStaging() { + StringReader r = new StringReader( "<deployment version='1.0'>" + - " <%s global-service-id='query' />" + - "</deployment>", - environment.value() - )); - - try { - DeploymentSpec.fromXml(r); - fail("Expected IllegalArgumentException for environment: " + environment); - } catch (IllegalArgumentException e) { - assertEquals("Attribute 'global-service-id' is only valid on 'prod' tag.", e.getMessage()); - } - } + " <staging global-service-id='query' />" + + "</deployment>" + ); + DeploymentSpec spec = DeploymentSpec.fromXml(r); } @Test @@ -169,9 +168,7 @@ public class DeploymentSpecTest { " <region active='true'>us-central-1</region>" + " <region active='true'>us-east-3</region>" + " </prod>" + - " <staging>" + - " <region active='true'>us-east-3</region>" + - " </staging>" + + " <staging/>" + "</deployment>" ); |