@Test public void should_not_resolve_property_if_not_set_in_config_and_system_property() { final EnricherExpressionResolver resolver = new EnricherExpressionResolver(ConfigurationParameters.from("foo", "bar")); final String resolvedString = resolver.resolve("${app.name}"); assertThat(resolvedString).isEqualTo("${app.name}"); }
public String resolve(String property) { final String replacedProperties = StringPropertyReplacer.replaceProperties(property); if (!property.equals(replacedProperties)) { return replacedProperties; } else { final Map<String, String> configParams = configurationParameters.getConfigParams(); final String propertyValue = configParams.get(propertyWithoutExpression(property)); return propertyValue != null ? propertyValue : property; } }
EnricherExpressionResolver { public String resolve(String property) { final String replacedProperties = StringPropertyReplacer.replaceProperties(property); if (!property.equals(replacedProperties)) { return replacedProperties; } else { final Map<String, String> configParams = configurationParameters.getConfigParams(); final String propertyValue = configParams.get(propertyWithoutExpression(property)); return propertyValue != null ? propertyValue : property; } } }
EnricherExpressionResolver { public String resolve(String property) { final String replacedProperties = StringPropertyReplacer.replaceProperties(property); if (!property.equals(replacedProperties)) { return replacedProperties; } else { final Map<String, String> configParams = configurationParameters.getConfigParams(); final String propertyValue = configParams.get(propertyWithoutExpression(property)); return propertyValue != null ? propertyValue : property; } } EnricherExpressionResolver(ConfigurationParameters configurationParameters); }
EnricherExpressionResolver { public String resolve(String property) { final String replacedProperties = StringPropertyReplacer.replaceProperties(property); if (!property.equals(replacedProperties)) { return replacedProperties; } else { final Map<String, String> configParams = configurationParameters.getConfigParams(); final String propertyValue = configParams.get(propertyWithoutExpression(property)); return propertyValue != null ? propertyValue : property; } } EnricherExpressionResolver(ConfigurationParameters configurationParameters); String resolve(String property); }
EnricherExpressionResolver { public String resolve(String property) { final String replacedProperties = StringPropertyReplacer.replaceProperties(property); if (!property.equals(replacedProperties)) { return replacedProperties; } else { final Map<String, String> configParams = configurationParameters.getConfigParams(); final String propertyValue = configParams.get(propertyWithoutExpression(property)); return propertyValue != null ? propertyValue : property; } } EnricherExpressionResolver(ConfigurationParameters configurationParameters); String resolve(String property);  }