From bf9a3a0fb225de64c89705c0529f3133c54e0db4 Mon Sep 17 00:00:00 2001 From: cgoldfeder Date: Tue, 13 Sep 2016 19:18:34 -0700 Subject: [PATCH] Add some more configs to ConfigModule and provide it in flow tests ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=133079669 --- java/google/registry/config/ConfigModule.java | 18 ++++++++++++++++++ .../registry/flows/EppTestComponent.java | 3 +++ 2 files changed, 21 insertions(+) diff --git a/java/google/registry/config/ConfigModule.java b/java/google/registry/config/ConfigModule.java index 74091525b..8a5d242a8 100644 --- a/java/google/registry/config/ConfigModule.java +++ b/java/google/registry/config/ConfigModule.java @@ -658,4 +658,22 @@ public final class ConfigModule { public static Duration provideMetricsWriteInterval() { return Duration.standardSeconds(60); } + + @Provides + @Config("contactAutomaticTransferLength") + public static Duration provideContactAutomaticTransferLength(RegistryConfig config) { + return config.getContactAutomaticTransferLength(); + } + + @Provides + @Config("asyncDeleteFlowMapreduceDelay") + public static Duration provideAsyncDeleteFlowMapreduceDelay(RegistryConfig config) { + return config.getAsyncDeleteFlowMapreduceDelay(); + } + + @Provides + @Config("maxChecks") + public static int provideMaxChecks(RegistryConfig config) { + return config.getMaxChecks(); + } } diff --git a/javatests/google/registry/flows/EppTestComponent.java b/javatests/google/registry/flows/EppTestComponent.java index fd8062c7a..9757677c2 100644 --- a/javatests/google/registry/flows/EppTestComponent.java +++ b/javatests/google/registry/flows/EppTestComponent.java @@ -21,6 +21,7 @@ import dagger.Component; import dagger.Module; import dagger.Provides; import dagger.Subcomponent; +import google.registry.config.ConfigModule; import google.registry.monitoring.whitebox.BigQueryMetricsEnqueuer; import google.registry.monitoring.whitebox.EppMetric; import google.registry.request.RequestScope; @@ -32,6 +33,7 @@ import javax.inject.Singleton; @Singleton @Component( modules = { + ConfigModule.class, EppTestComponent.FakesAndMocksModule.class }) interface EppTestComponent { @@ -82,3 +84,4 @@ interface EppTestComponent { FlowComponent.Builder flowComponentBuilder(); } } +