From e258eee5827b5d805c48385f2baafb0e2a40c071 Mon Sep 17 00:00:00 2001 From: weiminyu Date: Wed, 19 Sep 2018 08:47:47 -0700 Subject: [PATCH] Mark CloudDnsConfigTest as GoogleInternal Tests reference internal config settings not included in open source release. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=213634437 --- .../registry/config/CloudDnsConfigTest.java | 72 ------------------- 1 file changed, 72 deletions(-) delete mode 100644 javatests/google/registry/config/CloudDnsConfigTest.java diff --git a/javatests/google/registry/config/CloudDnsConfigTest.java b/javatests/google/registry/config/CloudDnsConfigTest.java deleted file mode 100644 index 0be705654..000000000 --- a/javatests/google/registry/config/CloudDnsConfigTest.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2018 The Nomulus Authors. All Rights Reserved. -// -// Licensed 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 google.registry.config; - -import static com.google.common.truth.Truth.assertThat; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import google.registry.config.RegistryConfig.ConfigModule; -import java.util.Collection; -import java.util.Map; -import java.util.Optional; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameter; -import org.junit.runners.Parameterized.Parameters; - -/** Unit tests for environment-specific CloudDns configurations. */ -@RunWith(Parameterized.class) -public class CloudDnsConfigTest { - - @Parameters - public static final Collection environments() { - return ImmutableList.copyOf(RegistryEnvironment.values()); - } - - private static final ImmutableList> TEST_CONFIGS = - ImmutableList.of( - Optional.of("https://staging-www.sandbox.googleapis.com"), - Optional.of("dns/v2beta1_staging/projects/")); - - private static final ImmutableList> PROD_CONFIGS = - ImmutableList.of(Optional.empty(), Optional.empty()); - - private static final Map>> data = - ImmutableMap.of( - RegistryEnvironment.PRODUCTION, PROD_CONFIGS, - RegistryEnvironment.SANDBOX, PROD_CONFIGS); - - @Parameter public RegistryEnvironment environment; - - private RegistryConfigSettings registryConfigSettings; - - @Before - public void setup() { - System.setProperty(RegistryEnvironment.PROPERTY, environment.name()); - registryConfigSettings = YamlUtils.getConfigSettings(); - } - - @Test - public void test() { - ImmutableList> expectedConfigs = data.getOrDefault(environment, TEST_CONFIGS); - assertThat(ConfigModule.getCloudDnsRootUrl(registryConfigSettings)) - .isEqualTo(expectedConfigs.get(0)); - assertThat(ConfigModule.getCloudDnsServicePath(registryConfigSettings)) - .isEqualTo(expectedConfigs.get(1)); - } -}