提交 3a5fb1fd 编写于 作者: R Rossen Stoyanchev

Fix test failing after #99302f

上级 71396121
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
package org.springframework.context.config; package org.springframework.context.config;
import java.io.FileNotFoundException;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
...@@ -32,6 +31,7 @@ import org.springframework.mock.env.MockEnvironment; ...@@ -32,6 +31,7 @@ import org.springframework.mock.env.MockEnvironment;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
/** /**
* @author Arjen Poutsma * @author Arjen Poutsma
...@@ -129,14 +129,14 @@ public class ContextNamespaceHandlerTests { ...@@ -129,14 +129,14 @@ public class ContextNamespaceHandlerTests {
@Test @Test
public void propertyPlaceholderLocationWithSystemPropertyMissing() { public void propertyPlaceholderLocationWithSystemPropertyMissing() {
try { try {
ApplicationContext applicationContext = new ClassPathXmlApplicationContext( new ClassPathXmlApplicationContext(
"contextNamespaceHandlerTests-location-placeholder.xml", getClass()); "contextNamespaceHandlerTests-location-placeholder.xml", getClass());
assertEquals("bar", applicationContext.getBean("foo")); fail("Should have thrown FatalBeanException");
assertEquals("foo", applicationContext.getBean("bar"));
assertEquals("maps", applicationContext.getBean("spam"));
} }
catch (FatalBeanException ex) { 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());
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册