use of org.springframework.context.support.GenericXmlApplicationContext in project spring-framework by spring-projects.
the class ContextNamespaceHandlerTests method propertyPlaceholderEnvironmentProperties.
@Test
public void propertyPlaceholderEnvironmentProperties() {
MockEnvironment env = new MockEnvironment().withProperty("foo", "spam");
GenericXmlApplicationContext applicationContext = new GenericXmlApplicationContext();
applicationContext.setEnvironment(env);
applicationContext.load(new ClassPathResource("contextNamespaceHandlerTests-simple.xml", getClass()));
applicationContext.refresh();
assertThat(applicationContext.getBean("string")).isEqualTo("spam");
assertThat(applicationContext.getBean("fallback")).isEqualTo("none");
}
Aggregations