Daggerize TMCH/signed mark util classes

This allows them to support injectable configuration.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143709052
This commit is contained in:
mcilwain 2017-01-05 14:26:18 -08:00 committed by Ben McIlwain
parent 534e3ba01c
commit c05424b947
19 changed files with 242 additions and 165 deletions

View file

@ -31,6 +31,8 @@ import google.registry.monitoring.whitebox.EppMetric;
import google.registry.request.RequestScope;
import google.registry.testing.FakeClock;
import google.registry.testing.FakeSleeper;
import google.registry.tmch.TmchCertificateAuthority;
import google.registry.tmch.TmchXmlSignature;
import google.registry.util.Clock;
import google.registry.util.Sleeper;
import javax.inject.Singleton;
@ -58,9 +60,15 @@ interface EppTestComponent {
final ModulesService modulesService;
final Sleeper sleeper;
FakesAndMocksModule(FakeClock clock) {
FakesAndMocksModule() {
this(new FakeClock(), true);
}
FakesAndMocksModule(FakeClock clock, boolean tmchCaTestingMode) {
this.clock = clock;
this.domainFlowTmchUtils = new DomainFlowTmchUtils();
this.domainFlowTmchUtils =
new DomainFlowTmchUtils(
new TmchXmlSignature(new TmchCertificateAuthority(tmchCaTestingMode)));
this.sleeper = new FakeSleeper(clock);
this.dnsQueue = DnsQueue.create();
this.metricBuilder = EppMetric.builderForRequest("request-id-1", clock);