From 45b555034aa9381d07b0f07da53f5c47cb6c34d3 Mon Sep 17 00:00:00 2001 From: YongGang Date: Thu, 19 Oct 2023 09:57:55 -0700 Subject: [PATCH] add more tests --- .../k8s/overlord/RunnerSelectorSpecTest.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 extensions-contrib/kubernetes-overlord-extensions/src/test/java/org/apache/druid/k8s/overlord/RunnerSelectorSpecTest.java diff --git a/extensions-contrib/kubernetes-overlord-extensions/src/test/java/org/apache/druid/k8s/overlord/RunnerSelectorSpecTest.java b/extensions-contrib/kubernetes-overlord-extensions/src/test/java/org/apache/druid/k8s/overlord/RunnerSelectorSpecTest.java new file mode 100644 index 000000000000..bea30d9e9689 --- /dev/null +++ b/extensions-contrib/kubernetes-overlord-extensions/src/test/java/org/apache/druid/k8s/overlord/RunnerSelectorSpecTest.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.druid.k8s.overlord; + +import org.junit.Assert; +import org.junit.Test; + +public class RunnerSelectorSpecTest +{ + @Test + public void test_whenInvalidDefaultValueConfigured_throwException() + { + Assert.assertThrows(RuntimeException.class, () -> new RunnerSelectorSpec(null, null)); + Assert.assertThrows(RuntimeException.class, () -> new RunnerSelectorSpec("unknownRunnerType", null)); + } +}