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