mirror of
https://github.com/google/nomulus.git
synced 2025-07-24 03:30:46 +02:00
Remove the old RegistryConfig paradigm entirely
We are now ready to begin configuration using YAML, mediated by ConfigModule. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=143818507
This commit is contained in:
parent
c5c74961bb
commit
d3397e991e
17 changed files with 18 additions and 323 deletions
|
@ -33,7 +33,6 @@ import google.registry.model.registry.Registry;
|
|||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.InjectRule;
|
||||
import google.registry.testing.RegistryConfigRule;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.Duration;
|
||||
import org.junit.Before;
|
||||
|
@ -54,9 +53,6 @@ public class CommitLogCheckpointStrategyTest {
|
|||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
||||
@Rule
|
||||
public final RegistryConfigRule configRule = new RegistryConfigRule();
|
||||
|
||||
final FakeClock clock = new FakeClock(DateTime.parse("2000-01-01TZ"));
|
||||
final Ofy ofy = new Ofy(clock);
|
||||
final CommitLogCheckpointStrategy strategy = new CommitLogCheckpointStrategy();
|
||||
|
|
|
@ -49,7 +49,6 @@ import google.registry.model.ofy.CommitLogMutation;
|
|||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeSleeper;
|
||||
import google.registry.testing.RegistryConfigRule;
|
||||
import google.registry.testing.TestObject;
|
||||
import google.registry.util.Retrier;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
@ -80,9 +79,6 @@ public class RestoreCommitLogsActionTest {
|
|||
.withDatastore()
|
||||
.build();
|
||||
|
||||
@Rule
|
||||
public final RegistryConfigRule configRule = new RegistryConfigRule();
|
||||
|
||||
@Before
|
||||
public void init() {
|
||||
ObjectifyService.register(TestObject.class);
|
||||
|
|
|
@ -32,7 +32,6 @@ import static org.mockito.Mockito.verify;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.config.RegistryEnvironment;
|
||||
import google.registry.model.common.Cursor;
|
||||
import google.registry.model.ofy.Ofy;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
|
@ -55,8 +54,6 @@ import org.mockito.runners.MockitoJUnitRunner;
|
|||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class SyncRegistrarsSheetTest {
|
||||
|
||||
private static final RegistryEnvironment ENVIRONMENT = RegistryEnvironment.get();
|
||||
|
||||
@Rule
|
||||
public final AppEngineRule appEngine = AppEngineRule.builder()
|
||||
.withDatastore()
|
||||
|
@ -345,8 +342,7 @@ public class SyncRegistrarsSheetTest {
|
|||
assertThat(row).containsEntry("blockPremiumNames", "false");
|
||||
assertThat(row).containsEntry("ipAddressWhitelist", "");
|
||||
assertThat(row).containsEntry("url", "");
|
||||
assertThat(row).containsEntry("referralUrl",
|
||||
ENVIRONMENT.config().getRegistrarDefaultReferralUrl().toString());
|
||||
assertThat(row).containsEntry("referralUrl", getRegistrarDefaultReferralUrl().toString());
|
||||
assertThat(row).containsEntry("icannReferralEmail", "");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ import static org.joda.time.DateTimeZone.UTC;
|
|||
import com.google.common.collect.ImmutableMap;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.RegistryConfigRule;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
@ -37,9 +36,6 @@ public class CommitLogCheckpointTest {
|
|||
.withDatastore()
|
||||
.build();
|
||||
|
||||
@Rule
|
||||
public final RegistryConfigRule configRule = new RegistryConfigRule();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
|
||||
|
|
|
@ -1,56 +0,0 @@
|
|||
// Copyright 2016 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.testing;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import google.registry.config.RegistryConfig;
|
||||
import google.registry.config.RegistryEnvironment;
|
||||
import org.junit.rules.ExternalResource;
|
||||
|
||||
/** JUnit Rule for overriding Nomulus configuration values. */
|
||||
@Deprecated // is obsoleted by YAML config; see b/33386530 for details
|
||||
public final class RegistryConfigRule extends ExternalResource {
|
||||
|
||||
private final Optional<RegistryConfig> override;
|
||||
|
||||
/** Creates a new instance where {@link #override(RegistryConfig)} will be called as needed. */
|
||||
public RegistryConfigRule() {
|
||||
this.override = Optional.absent();
|
||||
}
|
||||
|
||||
/** Creates a new instance where {@code override} will be used for each test method. */
|
||||
public RegistryConfigRule(RegistryConfig override) {
|
||||
this.override = Optional.of(override);
|
||||
}
|
||||
|
||||
/** Override registry configuration from inside a test method. */
|
||||
public void override(RegistryConfig override) {
|
||||
RegistryEnvironment.overrideConfigurationForTesting(checkNotNull(override));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void before() throws Exception {
|
||||
if (override.isPresent()) {
|
||||
RegistryEnvironment.overrideConfigurationForTesting(override.get());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void after() {
|
||||
RegistryEnvironment.overrideConfigurationForTesting(null);
|
||||
}
|
||||
}
|
|
@ -26,7 +26,6 @@ import google.registry.testing.BouncyCastleProviderRule;
|
|||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.InjectRule;
|
||||
import google.registry.testing.RegistryConfigRule;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -51,9 +50,6 @@ public class TmchActionTestCase {
|
|||
@Rule
|
||||
public final BouncyCastleProviderRule bouncy = new BouncyCastleProviderRule();
|
||||
|
||||
@Rule
|
||||
public final RegistryConfigRule configRule = new RegistryConfigRule();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ import google.registry.testing.AppEngineRule;
|
|||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.InjectRule;
|
||||
import google.registry.testing.RegistryConfigRule;
|
||||
import java.security.SignatureException;
|
||||
import java.security.cert.CertificateExpiredException;
|
||||
import java.security.cert.CertificateNotYetValidException;
|
||||
|
@ -52,9 +51,6 @@ public class TmchXmlSignatureTest {
|
|||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
||||
@Rule
|
||||
public final RegistryConfigRule configRule = new RegistryConfigRule();
|
||||
|
||||
private final FakeClock clock = new FakeClock(DateTime.parse("2013-11-24T23:15:37.4Z"));
|
||||
private byte[] smdData;
|
||||
private TmchXmlSignature tmchXmlSignature;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue