Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix false negative test failure in ResourceTests

Prior to changes in commit 57851de,
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
  • Loading branch information...
commit 1d9d3e6ff79ce9f0eca03b02cd1df705925575da 1 parent 8e0b1c3
@cbeams cbeams authored
View
10 org.springframework.core/src/test/java/org/springframework/core/io/ResourceTests.java
@@ -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 InputStream getInputStream() {
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());
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.