mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Remove extraneous modules from FlowComponent
This change removes ConfigModule from FlowComponent, since it's already present in all of the standard components that serve as "parents" to FlowComponent (i.e. it's in FrontendComponent, BackendComponent, ToolsComponent, and EppTestComponent). ConfigModule should only ever be included in top-level components, so that it's possible to swap it out without having to make changes deep within subcomponent code. This change also removes SystemSleeperModule, which belongs at the top-level component as well, and is present in BackendComponent and ToolsComponent but was absent in FrontendComponent and EppTestComponent. I've added it to those two places. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=140053552
This commit is contained in:
parent
5eb9702f05
commit
aa670e5df2
3 changed files with 12 additions and 5 deletions
|
@ -17,7 +17,6 @@ package google.registry.flows;
|
|||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import dagger.Subcomponent;
|
||||
import google.registry.config.ConfigModule;
|
||||
import google.registry.dns.DnsModule;
|
||||
import google.registry.flows.async.AsyncFlowsModule;
|
||||
import google.registry.flows.contact.ContactCheckFlow;
|
||||
|
@ -60,18 +59,15 @@ import google.registry.flows.session.HelloFlow;
|
|||
import google.registry.flows.session.LoginFlow;
|
||||
import google.registry.flows.session.LogoutFlow;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.util.SystemSleeper.SystemSleeperModule;
|
||||
|
||||
/** Dagger component for flow classes. */
|
||||
@FlowScope
|
||||
@Subcomponent(modules = {
|
||||
AsyncFlowsModule.class,
|
||||
ConfigModule.class,
|
||||
CustomLogicModule.class,
|
||||
DnsModule.class,
|
||||
FlowModule.class,
|
||||
FlowComponent.FlowComponentModule.class,
|
||||
SystemSleeperModule.class})
|
||||
FlowComponent.FlowComponentModule.class})
|
||||
public interface FlowComponent {
|
||||
|
||||
Trid trid();
|
||||
|
|
|
@ -31,6 +31,7 @@ import google.registry.request.Modules.UseAppIdentityCredentialForGoogleApisModu
|
|||
import google.registry.request.Modules.UserServiceModule;
|
||||
import google.registry.ui.ConsoleConfigModule;
|
||||
import google.registry.util.SystemClock.SystemClockModule;
|
||||
import google.registry.util.SystemSleeper.SystemSleeperModule;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
/** Dagger component with instance lifetime for "default" App Engine module. */
|
||||
|
@ -50,6 +51,7 @@ import javax.inject.Singleton;
|
|||
ModulesServiceModule.class,
|
||||
StackdriverModule.class,
|
||||
SystemClockModule.class,
|
||||
SystemSleeperModule.class,
|
||||
UrlFetchTransportModule.class,
|
||||
UseAppIdentityCredentialForGoogleApisModule.class,
|
||||
UserServiceModule.class,
|
||||
|
|
|
@ -28,7 +28,9 @@ import google.registry.monitoring.whitebox.BigQueryMetricsEnqueuer;
|
|||
import google.registry.monitoring.whitebox.EppMetric;
|
||||
import google.registry.request.RequestScope;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeSleeper;
|
||||
import google.registry.util.Clock;
|
||||
import google.registry.util.Sleeper;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
/** Dagger component for running EPP tests. */
|
||||
|
@ -48,6 +50,7 @@ interface EppTestComponent {
|
|||
static class FakesAndMocksModule {
|
||||
|
||||
final FakeClock clock;
|
||||
final Sleeper sleeper;
|
||||
final DnsQueue dnsQueue;
|
||||
final BigQueryMetricsEnqueuer metricsEnqueuer;
|
||||
final EppMetric.Builder metricBuilder;
|
||||
|
@ -55,6 +58,7 @@ interface EppTestComponent {
|
|||
|
||||
FakesAndMocksModule(FakeClock clock) {
|
||||
this.clock = clock;
|
||||
this.sleeper = new FakeSleeper(clock);
|
||||
this.dnsQueue = DnsQueue.create();
|
||||
this.metricBuilder = EppMetric.builderForRequest("request-id-1", clock);
|
||||
this.modulesService = mock(ModulesService.class);
|
||||
|
@ -66,6 +70,11 @@ interface EppTestComponent {
|
|||
return clock;
|
||||
}
|
||||
|
||||
@Provides
|
||||
Sleeper provideSleeper() {
|
||||
return sleeper;
|
||||
}
|
||||
|
||||
@Provides
|
||||
DnsQueue provideDnsQueue() {
|
||||
return dnsQueue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue