Skip to content

Commit 5f75413

Browse files
committed
Fix test failing after #99302f
1 parent 99302fd commit 5f75413

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

spring-context/src/test/java/org/springframework/context/config/ContextNamespaceHandlerTests.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package org.springframework.context.config;
1818

19-
import java.io.FileNotFoundException;
2019
import java.util.Calendar;
2120
import java.util.Date;
2221

@@ -30,7 +29,9 @@
3029
import org.springframework.core.io.ClassPathResource;
3130
import org.springframework.mock.env.MockEnvironment;
3231

33-
import static org.junit.Assert.*;
32+
import static org.junit.Assert.assertEquals;
33+
import static org.junit.Assert.assertTrue;
34+
import static org.junit.Assert.fail;
3435

3536
/**
3637
* @author Arjen Poutsma
@@ -128,14 +129,14 @@ public void propertyPlaceholderLocationWithSystemPropertyForMultipleLocations()
128129
@Test
129130
public void propertyPlaceholderLocationWithSystemPropertyMissing() {
130131
try {
131-
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
132+
new ClassPathXmlApplicationContext(
132133
"contextNamespaceHandlerTests-location-placeholder.xml", getClass());
133-
assertEquals("bar", applicationContext.getBean("foo"));
134-
assertEquals("foo", applicationContext.getBean("bar"));
135-
assertEquals("maps", applicationContext.getBean("spam"));
134+
fail("Should have thrown FatalBeanException");
136135
}
137136
catch (FatalBeanException ex) {
138-
assertTrue(ex.getRootCause() instanceof FileNotFoundException);
137+
Throwable cause = ex.getRootCause();
138+
assertTrue(cause instanceof IllegalArgumentException);
139+
assertEquals("Could not resolve placeholder 'foo' in value \"${foo}\"", cause.getMessage());
139140
}
140141
}
141142

0 commit comments

Comments
 (0)