Revise tests to better express intent

This commit is contained in:
Sam Brannen
2025-03-06 17:32:32 +01:00
parent 2d88f18bf1
commit 8334cb1abb
2 changed files with 7 additions and 4 deletions

View File

@@ -31,6 +31,8 @@ import org.springframework.core.io.Resource;
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
import org.springframework.web.testfixture.server.MockServerWebExchange;
import static org.assertj.core.api.Assertions.assertThatNoException;
/**
* @author Arjen Poutsma
*/
@@ -128,13 +130,13 @@ class PathResourceLookupFunctionTests {
@SuppressWarnings("removal")
void withPathResource() {
org.springframework.core.io.PathResource location = new org.springframework.core.io.PathResource("/static/");
PathResourceLookupFunction function = new PathResourceLookupFunction("/resources/**", location);
assertThatNoException().isThrownBy(() -> new PathResourceLookupFunction("/resources/**", location));
}
@Test
void withFileSystemResource() {
FileSystemResource location = new FileSystemResource("/static/");
PathResourceLookupFunction function = new PathResourceLookupFunction("/resources/**", location);
assertThatNoException().isThrownBy(() -> new PathResourceLookupFunction("/resources/**", location));
}
}

View File

@@ -29,6 +29,7 @@ import org.springframework.core.io.Resource;
import org.springframework.web.servlet.handler.PathPatternsTestUtils;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatNoException;
/**
* @author Arjen Poutsma
@@ -107,13 +108,13 @@ class PathResourceLookupFunctionTests {
@SuppressWarnings("removal")
void withPathResource() {
org.springframework.core.io.PathResource location = new org.springframework.core.io.PathResource("/static/");
PathResourceLookupFunction function = new PathResourceLookupFunction("/resources/**", location);
assertThatNoException().isThrownBy(() -> new PathResourceLookupFunction("/resources/**", location));
}
@Test
void withFileSystemResource() {
FileSystemResource location = new FileSystemResource("/static/");
PathResourceLookupFunction function = new PathResourceLookupFunction("/resources/**", location);
assertThatNoException().isThrownBy(() -> new PathResourceLookupFunction("/resources/**", location));
}
}