Register JndiPropertySource by default in servlet environments
Prior to this change, StandardServletEnvironment evaluated a "jndiPropertySourceEnabled" flag to determine whether or not to add a JndiPropertySource. Following the changes introduced in SPR-8490, there is now no reason not to enable a JNDI property source by default. This change eliminates the support for "jndiPropertySourceEnabled" and adds a JndiPropertySource automatically. Issue: SPR-8545, SPR-8490
This commit is contained in:
@@ -36,7 +36,7 @@ public class JndiPropertySourceTests {
|
||||
|
||||
@Test
|
||||
public void nonExistentProperty() {
|
||||
JndiPropertySource ps = new JndiPropertySource();
|
||||
JndiPropertySource ps = new JndiPropertySource("jndiProperties");
|
||||
assertThat(ps.getProperty("bogus"), nullValue());
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class JndiPropertySourceTests {
|
||||
jndiLocator.setResourceRef(true);
|
||||
jndiLocator.setJndiTemplate(jndiTemplate);
|
||||
|
||||
JndiPropertySource ps = new JndiPropertySource(jndiLocator);
|
||||
JndiPropertySource ps = new JndiPropertySource("jndiProperties", jndiLocator);
|
||||
assertThat((String)ps.getProperty("p1"), equalTo("v1"));
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class JndiPropertySourceTests {
|
||||
jndiLocator.setResourceRef(true);
|
||||
jndiLocator.setJndiTemplate(jndiTemplate);
|
||||
|
||||
JndiPropertySource ps = new JndiPropertySource(jndiLocator);
|
||||
JndiPropertySource ps = new JndiPropertySource("jndiProperties", jndiLocator);
|
||||
assertThat((String)ps.getProperty("p1"), equalTo("v1"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user