Relax relative path existence assertion for parsed URIs
See gh-29481 See gh-28522
This commit is contained in:
@@ -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<Resource> 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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user