@Test public void appliesOverrides() { ConfigurationParser<StubConfiguration> parser = new ConfigurationParser.Builder<StubConfiguration>() .format(format) .overrides(ImmutableMap.of("string", "overridden")) .build(); StubConfiguration parsedConfiguration = parser.parse(configSource(newResource("/fake/base-config.yml"))); assertThat(parsedConfiguration.get("string"), isValue("overridden")); }
public C parse(ConfigurationSource provider) { LOGGER.debug("Parsing configuration in format={} from source={}", format, provider); C configuration = doParse(provider).withOverrides(overrides); PlaceholderResolutionResult<C> resolved = configuration.resolvePlaceholders(overrides); if (!resolved.unresolvedPlaceholders().isEmpty()) { throw new IllegalStateException(format("Unresolved placeholders: %s", resolved.unresolvedPlaceholders())); } return resolved.resolvedConfiguration(); }
ConfigurationParser { public C parse(ConfigurationSource provider) { LOGGER.debug("Parsing configuration in format={} from source={}", format, provider); C configuration = doParse(provider).withOverrides(overrides); PlaceholderResolutionResult<C> resolved = configuration.resolvePlaceholders(overrides); if (!resolved.unresolvedPlaceholders().isEmpty()) { throw new IllegalStateException(format("Unresolved placeholders: %s", resolved.unresolvedPlaceholders())); } return resolved.resolvedConfiguration(); } }
ConfigurationParser { public C parse(ConfigurationSource provider) { LOGGER.debug("Parsing configuration in format={} from source={}", format, provider); C configuration = doParse(provider).withOverrides(overrides); PlaceholderResolutionResult<C> resolved = configuration.resolvePlaceholders(overrides); if (!resolved.unresolvedPlaceholders().isEmpty()) { throw new IllegalStateException(format("Unresolved placeholders: %s", resolved.unresolvedPlaceholders())); } return resolved.resolvedConfiguration(); } private  ConfigurationParser(Builder<C> builder); }
ConfigurationParser { public C parse(ConfigurationSource provider) { LOGGER.debug("Parsing configuration in format={} from source={}", format, provider); C configuration = doParse(provider).withOverrides(overrides); PlaceholderResolutionResult<C> resolved = configuration.resolvePlaceholders(overrides); if (!resolved.unresolvedPlaceholders().isEmpty()) { throw new IllegalStateException(format("Unresolved placeholders: %s", resolved.unresolvedPlaceholders())); } return resolved.resolvedConfiguration(); } private  ConfigurationParser(Builder<C> builder); C parse(ConfigurationSource provider); }
ConfigurationParser { public C parse(ConfigurationSource provider) { LOGGER.debug("Parsing configuration in format={} from source={}", format, provider); C configuration = doParse(provider).withOverrides(overrides); PlaceholderResolutionResult<C> resolved = configuration.resolvePlaceholders(overrides); if (!resolved.unresolvedPlaceholders().isEmpty()) { throw new IllegalStateException(format("Unresolved placeholders: %s", resolved.unresolvedPlaceholders())); } return resolved.resolvedConfiguration(); } private  ConfigurationParser(Builder<C> builder); C parse(ConfigurationSource provider);  }