File tree 1 file changed +17
-0
lines changed
spring-core/src/test/java/org/springframework/util
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,23 @@ static Stream<Arguments> defaultValues() {
153
153
);
154
154
}
155
155
156
+ @ ParameterizedTest (name = "{0} -> {1}" )
157
+ @ MethodSource ("exactMatchPlaceholders" )
158
+ void placeholdersWithExactMatchAreConsidered (String text , String expected ) {
159
+ Properties properties = new Properties ();
160
+ properties .setProperty ("prefix://my-service" , "example-service" );
161
+ properties .setProperty ("px" , "prefix" );
162
+ properties .setProperty ("p1" , "${prefix://my-service}" );
163
+ assertThat (this .helper .replacePlaceholders (text , properties )).isEqualTo (expected );
164
+ }
165
+
166
+ static Stream <Arguments > exactMatchPlaceholders () {
167
+ return Stream .of (
168
+ Arguments .of ("${prefix://my-service}" , "example-service" ),
169
+ Arguments .of ("${p1}" , "example-service" )
170
+ );
171
+ }
172
+
156
173
}
157
174
158
175
PlaceholderResolver mockPlaceholderResolver (String ... pairs ) {
You can’t perform that action at this time.
0 commit comments