Use enum instead of boolean for TMCH CA mode

Also more narrowly scopes a catch block in TmchCertificateAuthority.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144744847
This commit is contained in:
mcilwain 2017-01-17 12:57:05 -08:00 committed by Ben McIlwain
parent 0dbaa8e5bc
commit a28e0b3ff7
13 changed files with 90 additions and 73 deletions

View file

@ -22,6 +22,7 @@ import dagger.Module;
import dagger.Provides;
import dagger.Subcomponent;
import google.registry.config.RegistryConfig.ConfigModule;
import google.registry.config.RegistryConfig.ConfigModule.TmchCaMode;
import google.registry.dns.DnsQueue;
import google.registry.flows.custom.CustomLogicFactory;
import google.registry.flows.custom.TestCustomLogicFactory;
@ -61,14 +62,13 @@ interface EppTestComponent {
final Sleeper sleeper;
FakesAndMocksModule() {
this(new FakeClock(), true);
this(new FakeClock(), TmchCaMode.PILOT);
}
FakesAndMocksModule(FakeClock clock, boolean tmchCaTestingMode) {
FakesAndMocksModule(FakeClock clock, TmchCaMode tmchCaMode) {
this.clock = clock;
this.domainFlowTmchUtils =
new DomainFlowTmchUtils(
new TmchXmlSignature(new TmchCertificateAuthority(tmchCaTestingMode)));
new DomainFlowTmchUtils(new TmchXmlSignature(new TmchCertificateAuthority(tmchCaMode)));
this.sleeper = new FakeSleeper(clock);
this.dnsQueue = DnsQueue.create();
this.metricBuilder = EppMetric.builderForRequest("request-id-1", clock);