diff options
author | jonmv <venstad@gmail.com> | 2022-04-12 12:49:40 +0200 |
---|---|---|
committer | jonmv <venstad@gmail.com> | 2022-04-12 12:49:40 +0200 |
commit | 55788b03e5980f75e93aef00657128e37c16491f (patch) | |
tree | 88db5d5b6df027cc791db6017f51c1f2d0352a7e /controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobTypeTest.java | |
parent | 69a792bd4285b66af2ef5cb322cd2ecb329e9c3f (diff) |
Make JobType non-enum, and prepare for serialisation with zone id instead
Diffstat (limited to 'controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobTypeTest.java')
-rw-r--r-- | controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobTypeTest.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobTypeTest.java b/controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobTypeTest.java index 51c20056ad4..990e8911e91 100644 --- a/controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobTypeTest.java +++ b/controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobTypeTest.java @@ -1,8 +1,14 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.api.integration.deployment; +import com.yahoo.config.provision.Environment; +import com.yahoo.config.provision.SystemName; +import com.yahoo.config.provision.zone.ZoneId; +import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneRegistry; import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; /** @@ -23,6 +29,33 @@ public class JobTypeTest { assertTrue(type + " should have matching job", match); } } + + assertEquals(JobType.testUsEast3, JobType.fromJobName("prod.us-east-3.test")); + assertEquals(JobType.devAwsUsEast1c, JobType.fromJobName("dev.aws-us-east-1c")); + + assertFalse(JobType.dev("snøhetta").isTest()); + assertTrue(JobType.dev("snøhetta").isDeployment()); + assertFalse(JobType.dev("snøhetta").isProduction()); + + assertFalse(JobType.perf("snøhetta").isTest()); + assertTrue(JobType.perf("snøhetta").isDeployment()); + assertFalse(JobType.perf("snøhetta").isProduction()); + + assertTrue(JobType.deploymentTo(ZoneId.from("test", "snøhetta")).isTest()); + assertTrue(JobType.deploymentTo(ZoneId.from("test", "snøhetta")).isDeployment()); + assertFalse(JobType.deploymentTo(ZoneId.from("test", "snøhetta")).isProduction()); + + assertTrue(JobType.deploymentTo(ZoneId.from("staging", "snøhetta")).isTest()); + assertTrue(JobType.deploymentTo(ZoneId.from("staging", "snøhetta")).isDeployment()); + assertFalse(JobType.deploymentTo(ZoneId.from("staging", "snøhetta")).isProduction()); + + assertFalse(JobType.prod("snøhetta").isTest()); + assertTrue(JobType.prod("snøhetta").isDeployment()); + assertTrue(JobType.prod("snøhetta").isProduction()); + + assertTrue(JobType.test("snøhetta").isTest()); + assertFalse(JobType.test("snøhetta").isDeployment()); + assertTrue(JobType.test("snøhetta").isProduction()); } } |