Search in sources :

Example 1 with PropertyPlaceholderHelper

use of com.navercorp.pinpoint.bootstrap.util.spring.PropertyPlaceholderHelper in project pinpoint by naver.

the class PropertyPlaceholderHelperTest method testReplacePlaceholders.

@Test
public void testReplacePlaceholders() {
    Properties properties = new Properties();
    properties.setProperty("test", "a");
    PropertyPlaceholderHelper helper = new PropertyPlaceholderHelper("${", "}");
    String value1 = helper.replacePlaceholders("${test}", properties);
    Assert.assertEquals("a", value1);
    String value2 = helper.replacePlaceholders("123${test}456", properties);
    Assert.assertEquals("123a456", value2);
    String value3 = helper.replacePlaceholders("123${test}456${test}", properties);
    Assert.assertEquals("123a456a", value3);
}
Also used : PropertyPlaceholderHelper(com.navercorp.pinpoint.bootstrap.util.spring.PropertyPlaceholderHelper) Properties(java.util.Properties) Test(org.junit.Test)

Aggregations

PropertyPlaceholderHelper (com.navercorp.pinpoint.bootstrap.util.spring.PropertyPlaceholderHelper)1 Properties (java.util.Properties)1 Test (org.junit.Test)1