Fix test failing after #99302f
This commit is contained in:
parent
71396121a7
commit
3a5fb1fdf3
|
@ -16,7 +16,6 @@
|
|||
|
||||
package org.springframework.context.config;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
|
@ -32,6 +31,7 @@ import org.springframework.mock.env.MockEnvironment;
|
|||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
/**
|
||||
* @author Arjen Poutsma
|
||||
|
@ -129,14 +129,14 @@ public class ContextNamespaceHandlerTests {
|
|||
@Test
|
||||
public void propertyPlaceholderLocationWithSystemPropertyMissing() {
|
||||
try {
|
||||
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
|
||||
new ClassPathXmlApplicationContext(
|
||||
"contextNamespaceHandlerTests-location-placeholder.xml", getClass());
|
||||
assertEquals("bar", applicationContext.getBean("foo"));
|
||||
assertEquals("foo", applicationContext.getBean("bar"));
|
||||
assertEquals("maps", applicationContext.getBean("spam"));
|
||||
fail("Should have thrown FatalBeanException");
|
||||
}
|
||||
catch (FatalBeanException ex) {
|
||||
assertTrue(ex.getRootCause() instanceof FileNotFoundException);
|
||||
Throwable cause = ex.getRootCause();
|
||||
assertTrue(cause instanceof IllegalArgumentException);
|
||||
assertEquals("Could not resolve placeholder 'foo' in value \"${foo}\"", cause.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue