@@ -300,6 +300,31 @@ void resolveNestedPropertyPlaceholders() {
300
300
.withMessageContaining ("Circular" );
301
301
}
302
302
303
+ @ Test
304
+ void resolveNestedPlaceholdersIfValueIsCharSequence () {
305
+ MutablePropertySources ps = new MutablePropertySources ();
306
+ ps .addFirst (new MockPropertySource ()
307
+ .withProperty ("p1" , "v1" )
308
+ .withProperty ("p2" , "v2" )
309
+ .withProperty ("p3" , new StringBuilder ("${p1}:${p2}" )));
310
+ ConfigurablePropertyResolver pr = new PropertySourcesPropertyResolver (ps );
311
+ assertThat (pr .getProperty ("p1" )).isEqualTo ("v1" );
312
+ assertThat (pr .getProperty ("p2" )).isEqualTo ("v2" );
313
+ assertThat (pr .getProperty ("p3" )).isEqualTo ("v1:v2" );
314
+ }
315
+
316
+ @ Test
317
+ void resolveNestedPlaceholdersIfValueIsCharSequenceAndStringBuilderIsRequested () {
318
+ MutablePropertySources ps = new MutablePropertySources ();
319
+ ps .addFirst (new MockPropertySource ()
320
+ .withProperty ("p1" , "v1" )
321
+ .withProperty ("p2" , "v2" )
322
+ .withProperty ("p3" , new StringBuilder ("${p1}:${p2}" )));
323
+ ConfigurablePropertyResolver pr = new PropertySourcesPropertyResolver (ps );
324
+ assertThat (pr .getProperty ("p3" , StringBuilder .class )).isInstanceOf (StringBuilder .class )
325
+ .hasToString ("${p1}:${p2}" );
326
+ }
327
+
303
328
@ Test
304
329
void ignoreUnresolvableNestedPlaceholdersIsConfigurable () {
305
330
MutablePropertySources ps = new MutablePropertySources ();
0 commit comments