@Test public void testReadAppConfig() throws Exception { ObjectMapper mapper = fixSerializationHelper(fixtures); AppConfigProvider configProvider = new AppConfigProvider(CORRECT_APP_CONFIG, mapper); AppConfig appConfig = configProvider.get(); assertThat(appConfig.global(), notNullValue()); assertThat(appConfig.global().configurationsPath(), equalTo("configurationsPath")); assertThat(appConfig.global().connectorsPath(), equalTo("connectorsPath")); assertThat(appConfig.global().runOnce(), equalTo(false)); assertThat(appConfig.global().updateConfigurationIntervalMillis(), equalTo(2L)); assertThat(appConfig.hazelcast(), notNullValue()); assertThat(appConfig.hazelcast().isEnabled(), equalTo(true)); assertThat(appConfig.hazelcast().config(), equalTo("config")); assertThat(appConfig.alert(), notNullValue()); assertThat(appConfig.alert().isEnabled(), equalTo(true)); assertThat(appConfig.alert().checkIntervalMillis(), equalTo(3L)); assertThat(appConfig.alert().thresholds(), hasEntry("thresholds", 4.0d)); }
@Override public AppConfig get() { return appConfig; }
AppConfigProvider implements Provider<AppConfig> { @Override public AppConfig get() { return appConfig; } }
AppConfigProvider implements Provider<AppConfig> { @Override public AppConfig get() { return appConfig; } @Inject  AppConfigProvider(@Named("config") String configFile, ObjectMapper mapper); }
AppConfigProvider implements Provider<AppConfig> { @Override public AppConfig get() { return appConfig; } @Inject  AppConfigProvider(@Named("config") String configFile, ObjectMapper mapper); @Override AppConfig get(); }
AppConfigProvider implements Provider<AppConfig> { @Override public AppConfig get() { return appConfig; } @Inject  AppConfigProvider(@Named("config") String configFile, ObjectMapper mapper); @Override AppConfig get();  }