@Test public void extractsPlaceholdersWithEmptyDefaults() { String valueWithPlaceholders = "foo: \"${FOO:}\""; List<String> placeholders = PlaceholderResolver.extractPlaceholderStrings(valueWithPlaceholders); assertThat(placeholders, contains("${FOO:}")); }
@VisibleForTesting static List<String> extractPlaceholderStrings(String value) { Matcher matcher = PLACEHOLDER_REGEX_CAPTURE_ALL.matcher(value); List<String> placeholders = new ArrayList<>(); while (matcher.find()) { placeholders.add(matcher.group()); } return placeholders; }
PlaceholderResolver { @VisibleForTesting static List<String> extractPlaceholderStrings(String value) { Matcher matcher = PLACEHOLDER_REGEX_CAPTURE_ALL.matcher(value); List<String> placeholders = new ArrayList<>(); while (matcher.find()) { placeholders.add(matcher.group()); } return placeholders; } }
PlaceholderResolver { @VisibleForTesting static List<String> extractPlaceholderStrings(String value) { Matcher matcher = PLACEHOLDER_REGEX_CAPTURE_ALL.matcher(value); List<String> placeholders = new ArrayList<>(); while (matcher.find()) { placeholders.add(matcher.group()); } return placeholders; } PlaceholderResolver(ObjectNode rootNode, Map<String, String> externalProperties); }
PlaceholderResolver { @VisibleForTesting static List<String> extractPlaceholderStrings(String value) { Matcher matcher = PLACEHOLDER_REGEX_CAPTURE_ALL.matcher(value); List<String> placeholders = new ArrayList<>(); while (matcher.find()) { placeholders.add(matcher.group()); } return placeholders; } PlaceholderResolver(ObjectNode rootNode, Map<String, String> externalProperties); static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties); static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Properties properties); Collection<UnresolvedPlaceholder> resolve(); @VisibleForTesting static String replacePlaceholder(String originalString, String placeholderName, String placeholderValue); @VisibleForTesting static List<Placeholder> extractPlaceholders(String value); }
PlaceholderResolver { @VisibleForTesting static List<String> extractPlaceholderStrings(String value) { Matcher matcher = PLACEHOLDER_REGEX_CAPTURE_ALL.matcher(value); List<String> placeholders = new ArrayList<>(); while (matcher.find()) { placeholders.add(matcher.group()); } return placeholders; } PlaceholderResolver(ObjectNode rootNode, Map<String, String> externalProperties); static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Map<String, String> externalProperties); static Collection<UnresolvedPlaceholder> resolvePlaceholders(JsonNode rootNode, Properties properties); Collection<UnresolvedPlaceholder> resolve(); @VisibleForTesting static String replacePlaceholder(String originalString, String placeholderName, String placeholderValue); @VisibleForTesting static List<Placeholder> extractPlaceholders(String value);  }