summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2021-06-14 20:00:57 +0200
committerJon Marius Venstad <venstad@gmail.com>2021-06-14 20:00:57 +0200
commiteb4c66482c9887082391cbf48890bd3ec0a9dd3a (patch)
tree195587b49e2d1e891047b3cf923fa33c66627a6b /controller-api
parent8b1315242a2595d0e4868a4f4896cee0ba6abe31 (diff)
Actually add unit test, and verify deployment spec before storing it
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobTypeTest.java28
1 files changed, 28 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
new file mode 100644
index 00000000000..22486875a0b
--- /dev/null
+++ b/controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobTypeTest.java
@@ -0,0 +1,28 @@
+// Copyright Verizon Media. 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 org.junit.Test;
+
+import static org.junit.Assert.assertTrue;
+
+/**
+ * @author jonmv
+ */
+public class JobTypeTest {
+
+ @Test
+ public void test() {
+ for (JobType type : JobType.values()) {
+ if (type.isProduction()) {
+ boolean match = false;
+ for (JobType other : JobType.values())
+ match |= type != other
+ && type.isTest() == other.isDeployment()
+ && type.zones.equals(other.zones);
+
+ assertTrue(type + " should have matching job", match);
+ }
+ }
+ }
+
+}