Fix false negative test failure in ResourceTests

Prior to changes in commit 57851de88e,
AbstractResource#getFilename threw IllegalStateException unless
overridden by a subclass. Following that change, this method now throws
null instead, but ResourceTests#testAbstractResourceExceptions had not
been updated to reflect, resulting in a false negative failure. This has
now been fixed.

Issue: SPR-9043
This commit is contained in:
Chris Beams 2012-02-13 15:47:31 +01:00
parent 8e0b1c3a5f
commit 1d9d3e6ff7
1 changed files with 3 additions and 7 deletions

View File

@ -16,6 +16,7 @@
package org.springframework.core.io;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.junit.Assert.*;
import java.io.ByteArrayInputStream;
@ -215,13 +216,8 @@ public class ResourceTests {
catch (FileNotFoundException ex) {
assertTrue(ex.getMessage().indexOf(name) != -1);
}
try {
resource.getFilename();
fail("IllegalStateException should have been thrown");
}
catch (IllegalStateException ex) {
assertTrue(ex.getMessage().indexOf(name) != -1);
}
assertThat(resource.getFilename(), nullValue());
}
}