File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed 
spring-core/src/test/java/org/springframework/util Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 11/* 
2-  * Copyright 2002-2023  the original author or authors. 
2+  * Copyright 2002-2024  the original author or authors. 
33 * 
44 * Licensed under the Apache License, Version 2.0 (the "License"); 
55 * you may not use this file except in compliance with the License. 
@@ -156,6 +156,23 @@ static Stream<Arguments> defaultValues() {
156156			);
157157		}
158158
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+ 
159176	}
160177
161178	PlaceholderResolver  mockPlaceholderResolver (String ... pairs ) {
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments