diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/resource/PathResourceResolverTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/resource/PathResourceResolverTests.java index 9290981ce4..4b9ba4e800 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/resource/PathResourceResolverTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/resource/PathResourceResolverTests.java @@ -30,7 +30,6 @@ import org.springframework.core.io.Resource; import org.springframework.core.io.UrlResource; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.fail; /** * Unit tests for {@link PathResourceResolver}. @@ -101,9 +100,6 @@ public class PathResourceResolverTests { private void testCheckResource(Resource location, String requestPath) throws IOException { List locations = Collections.singletonList(location); Resource actual = this.resolver.resolveResource(null, requestPath, locations, null).block(TIMEOUT); - if (!location.createRelative(requestPath).exists() && !requestPath.contains(":")) { - fail(requestPath + " doesn't actually exist as a relative path"); - } assertThat(actual).isNull(); } diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/resource/ResourceWebHandlerTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/resource/ResourceWebHandlerTests.java index 15432ea1a6..5b4ec3cd3d 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/resource/ResourceWebHandlerTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/resource/ResourceWebHandlerTests.java @@ -63,7 +63,6 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; -import static org.assertj.core.api.Assertions.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.mock; @@ -412,9 +411,6 @@ class ResourceWebHandlerTests { assertThat(((ResponseStatusException) err).getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND); }) .verify(TIMEOUT); - if (!location.createRelative(requestPath).exists() && !requestPath.contains(":")) { - fail(requestPath + " doesn't actually exist as a relative path"); - } } @Test diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/PathResourceResolverTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/PathResourceResolverTests.java index 9ac37c3e98..860a3e5c02 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/PathResourceResolverTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/PathResourceResolverTests.java @@ -33,7 +33,6 @@ import org.springframework.web.testfixture.servlet.MockServletContext; import org.springframework.web.util.UrlPathHelper; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.fail; /** * Unit tests for {@link PathResourceResolver}. @@ -86,9 +85,6 @@ public class PathResourceResolverTests { private void testCheckResource(Resource location, String requestPath) throws IOException { List locations = Collections.singletonList(location); Resource actual = this.resolver.resolveResource(null, requestPath, locations, null); - if (!location.createRelative(requestPath).exists() && !requestPath.contains(":")) { - fail(requestPath + " doesn't actually exist as a relative path"); - } assertThat(actual).isNull(); } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandlerTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandlerTests.java index 2fa3383bed..a677cc685f 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandlerTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandlerTests.java @@ -44,7 +44,6 @@ import org.springframework.web.testfixture.servlet.MockServletContext; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatIllegalStateException; -import static org.assertj.core.api.Assertions.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.mock; @@ -414,9 +413,6 @@ class ResourceHttpRequestHandlerTests { this.request.setAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, requestPath); this.response = new MockHttpServletResponse(); this.handler.handleRequest(this.request, this.response); - if (!location.createRelative(requestPath).exists() && !requestPath.contains(":")) { - fail(requestPath + " doesn't actually exist as a relative path"); - } assertThat(this.response.getStatus()).isEqualTo(HttpStatus.NOT_FOUND.value()); }