MutablePropertySources propertySources = new MutablePropertySources();
propertySources.addLast(new MockPropertySource());
PropertySourcesPlaceholderConfigurer pc = new PropertySourcesPlaceholderConfigurer();
pc.setPropertySources(propertySources);
pc.setEnvironment(new MockEnvironment().withProperty("my.name", "env"));
pc.setIgnoreUnresolvablePlaceholders(true);
pc.postProcessBeanFactory(bf);
assertThat(bf.getBean(TestBean.class).getName(), equalTo("${my.name}"));
assertEquals(pc.getAppliedPropertySources().iterator().next(), propertySources.iterator().next());
}