File tree 1 file changed +18
-1
lines changed
spring-core/src/test/java/org/springframework/util
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2023 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -156,6 +156,23 @@ static Stream<Arguments> defaultValues() {
156
156
);
157
157
}
158
158
159
+ @ ParameterizedTest (name = "{0} -> {1}" )
160
+ @ MethodSource ("exactMatchPlaceholders" )
161
+ void placeholdersWithExactMatchAreConsidered (String text , String expected ) {
162
+ Properties properties = new Properties ();
163
+ properties .setProperty ("prefix://my-service" , "example-service" );
164
+ properties .setProperty ("px" , "prefix" );
165
+ properties .setProperty ("p1" , "${prefix://my-service}" );
166
+ assertThat (this .helper .replacePlaceholders (text , properties )).isEqualTo (expected );
167
+ }
168
+
169
+ static Stream <Arguments > exactMatchPlaceholders () {
170
+ return Stream .of (
171
+ Arguments .of ("${prefix://my-service}" , "example-service" ),
172
+ Arguments .of ("${p1}" , "example-service" )
173
+ );
174
+ }
175
+
159
176
}
160
177
161
178
PlaceholderResolver mockPlaceholderResolver (String ... pairs ) {
You can’t perform that action at this time.
0 commit comments