use of org.springframework.context.support.PropertySourcesPlaceholderConfigurer in project spring-boot by spring-projects.
the class ServletWebServerApplicationContextTests method postProcessWebServerFactory.
@Test
void postProcessWebServerFactory() {
RootBeanDefinition beanDefinition = new RootBeanDefinition(MockServletWebServerFactory.class);
MutablePropertyValues pv = new MutablePropertyValues();
pv.add("port", "${port}");
beanDefinition.setPropertyValues(pv);
this.context.registerBeanDefinition("webServerFactory", beanDefinition);
PropertySourcesPlaceholderConfigurer propertySupport = new PropertySourcesPlaceholderConfigurer();
Properties properties = new Properties();
properties.put("port", 8080);
propertySupport.setProperties(properties);
this.context.registerBeanDefinition("propertySupport", beanDefinition(propertySupport));
this.context.refresh();
assertThat(getWebServerFactory().getWebServer().getPort()).isEqualTo(8080);
}
use of org.springframework.context.support.PropertySourcesPlaceholderConfigurer in project waltz by khartec.
the class DIConfiguration method propertySourcesPlaceholderConfigurer.
/**
* Required for property interpolation to work correctly
* @see <a href="http://stackoverflow.com/a/41760877/2311919">Explanation</a>
*/
@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer(ConfigurableEnvironment env) {
PropertySourcesPlaceholderConfigurer placeholderConfigurer = new PropertySourcesPlaceholderConfigurer();
JndiPropertySource jndiPropertySource = new JndiPropertySource("java:comp");
env.getPropertySources().addFirst(jndiPropertySource);
return placeholderConfigurer;
}
use of org.springframework.context.support.PropertySourcesPlaceholderConfigurer in project tutorials by eugenp.
the class CommitIdApplication method placeholderConfigurer.
@Bean
public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() {
PropertySourcesPlaceholderConfigurer c = new PropertySourcesPlaceholderConfigurer();
c.setLocation(new ClassPathResource("git.properties"));
c.setIgnoreResourceNotFound(true);
c.setIgnoreUnresolvablePlaceholders(true);
return c;
}
use of org.springframework.context.support.PropertySourcesPlaceholderConfigurer in project gpconnect-demonstrator by nhsconnect.
the class IntegrationTestConfig method propertySourcesPlaceholderConfigurer.
@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
propertySourcesPlaceholderConfigurer.setIgnoreUnresolvablePlaceholders(true);
return propertySourcesPlaceholderConfigurer;
}
Aggregations