Deprecate pathExtension routing predicates
Closes gh-34103
This commit is contained in:
@@ -223,6 +223,7 @@ class RequestPredicatesTests {
|
||||
assertThat(predicate.test(request)).isFalse();
|
||||
}
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
@Test
|
||||
void pathExtension() {
|
||||
RequestPredicate predicate = RequestPredicates.pathExtension("txt");
|
||||
@@ -237,6 +238,7 @@ class RequestPredicatesTests {
|
||||
assertThat(predicate.test(initRequest("GET", "/file"))).isFalse();
|
||||
}
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
@Test
|
||||
void pathExtensionPredicate() {
|
||||
List<String> extensions = List.of("foo", "bar");
|
||||
|
||||
@@ -29,7 +29,6 @@ import static org.springframework.web.servlet.function.RequestPredicates.method;
|
||||
import static org.springframework.web.servlet.function.RequestPredicates.methods;
|
||||
import static org.springframework.web.servlet.function.RequestPredicates.param;
|
||||
import static org.springframework.web.servlet.function.RequestPredicates.path;
|
||||
import static org.springframework.web.servlet.function.RequestPredicates.pathExtension;
|
||||
import static org.springframework.web.servlet.function.RouterFunctions.route;
|
||||
|
||||
/**
|
||||
@@ -61,6 +60,7 @@ class ToStringVisitorTests {
|
||||
assertThat(result).isEqualTo(expected);
|
||||
}
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
@Test
|
||||
void predicates() {
|
||||
testPredicate(methods(HttpMethod.GET), "GET");
|
||||
@@ -68,8 +68,6 @@ class ToStringVisitorTests {
|
||||
|
||||
testPredicate(path("/foo"), "/foo");
|
||||
|
||||
testPredicate(pathExtension("foo"), "*.foo");
|
||||
|
||||
testPredicate(contentType(MediaType.APPLICATION_JSON), "Content-Type: application/json");
|
||||
|
||||
ToStringVisitor visitor = new ToStringVisitor();
|
||||
|
||||
@@ -192,6 +192,7 @@ class RouterFunctionDslTests {
|
||||
null
|
||||
}
|
||||
}
|
||||
@Suppress("DEPRECATION")
|
||||
GET(pathExtension { it == "properties" }) {
|
||||
ok().body("foo=bar")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user