Backport tests for exact match resolution
See gh-34124
(cherry picked from commit 898d3ec86a
)
This commit is contained in:
parent
9de2b947cb
commit
c59ca087b4
|
@ -153,6 +153,23 @@ class PropertyPlaceholderHelperTests {
|
|||
);
|
||||
}
|
||||
|
||||
@ParameterizedTest(name = "{0} -> {1}")
|
||||
@MethodSource("exactMatchPlaceholders")
|
||||
void placeholdersWithExactMatchAreConsidered(String text, String expected) {
|
||||
Properties properties = new Properties();
|
||||
properties.setProperty("prefix://my-service", "example-service");
|
||||
properties.setProperty("px", "prefix");
|
||||
properties.setProperty("p1", "${prefix://my-service}");
|
||||
assertThat(this.helper.replacePlaceholders(text, properties)).isEqualTo(expected);
|
||||
}
|
||||
|
||||
static Stream<Arguments> exactMatchPlaceholders() {
|
||||
return Stream.of(
|
||||
Arguments.of("${prefix://my-service}", "example-service"),
|
||||
Arguments.of("${p1}", "example-service")
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
PlaceholderResolver mockPlaceholderResolver(String... pairs) {
|
||||
|
|
Loading…
Reference in New Issue