From eb4c66482c9887082391cbf48890bd3ec0a9dd3a Mon Sep 17 00:00:00 2001 From: Jon Marius Venstad Date: Mon, 14 Jun 2021 20:00:57 +0200 Subject: Actually add unit test, and verify deployment spec before storing it --- .../api/integration/deployment/JobTypeTest.java | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobTypeTest.java (limited to 'controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobTypeTest.java') 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); + } + } + } + +} -- cgit v1.2.3