@Test public void testSimpleConfigWithModuleAndApplicationDefaults() { Map<String, String> properties = ImmutableMap.of( "string-value", "some value", "boolean-value", "false" ); Map<String, String> applicationDefaults = ImmutableMap.of( "string-value", "some default value", "boolean-value", "true" ); Map<String, String> moduleDefaults = ImmutableMap.of( "string-value", "some module default value", "boolean-value", "true" ); Map<String, ConfigurationDefaultingModule> moduleDefaultSource = ImmutableMap.of( "string-value", TEST_DEFAULTING_MODULE, "boolean-value", TEST_DEFAULTING_MODULE ); inspect(properties, applicationDefaults, moduleDefaults, moduleDefaultSource, binder -> bindConfig(binder).bind(AnnotatedSetter.class)) .component("ConfigurationFactoryTest$AnnotatedSetter") .value("BooleanValue", "boolean-value", "true", "false", "") .value("StringValue", "string-value", "some default value", "some value", "") .end(); }
public SortedSet<ConfigRecord<?>> inspect(ConfigurationFactory configurationFactory) { ImmutableSortedSet.Builder<ConfigRecord<?>> builder = ImmutableSortedSet.naturalOrder(); for (ConfigurationIdentity<?> configurationIdentity : configurationFactory.getRegisteredConfigs()) { builder.add(ConfigRecord.createConfigRecord(configurationFactory, configurationIdentity)); } return builder.build(); }
ConfigurationInspector { public SortedSet<ConfigRecord<?>> inspect(ConfigurationFactory configurationFactory) { ImmutableSortedSet.Builder<ConfigRecord<?>> builder = ImmutableSortedSet.naturalOrder(); for (ConfigurationIdentity<?> configurationIdentity : configurationFactory.getRegisteredConfigs()) { builder.add(ConfigRecord.createConfigRecord(configurationFactory, configurationIdentity)); } return builder.build(); } }
ConfigurationInspector { public SortedSet<ConfigRecord<?>> inspect(ConfigurationFactory configurationFactory) { ImmutableSortedSet.Builder<ConfigRecord<?>> builder = ImmutableSortedSet.naturalOrder(); for (ConfigurationIdentity<?> configurationIdentity : configurationFactory.getRegisteredConfigs()) { builder.add(ConfigRecord.createConfigRecord(configurationFactory, configurationIdentity)); } return builder.build(); }  }
ConfigurationInspector { public SortedSet<ConfigRecord<?>> inspect(ConfigurationFactory configurationFactory) { ImmutableSortedSet.Builder<ConfigRecord<?>> builder = ImmutableSortedSet.naturalOrder(); for (ConfigurationIdentity<?> configurationIdentity : configurationFactory.getRegisteredConfigs()) { builder.add(ConfigRecord.createConfigRecord(configurationFactory, configurationIdentity)); } return builder.build(); }  SortedSet<ConfigRecord<?>> inspect(ConfigurationFactory configurationFactory); }
ConfigurationInspector { public SortedSet<ConfigRecord<?>> inspect(ConfigurationFactory configurationFactory) { ImmutableSortedSet.Builder<ConfigRecord<?>> builder = ImmutableSortedSet.naturalOrder(); for (ConfigurationIdentity<?> configurationIdentity : configurationFactory.getRegisteredConfigs()) { builder.add(ConfigRecord.createConfigRecord(configurationFactory, configurationIdentity)); } return builder.build(); }  SortedSet<ConfigRecord<?>> inspect(ConfigurationFactory configurationFactory);  }