mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-02 23:39:34 +00:00
Merge branch '3.5.x' into 4.0.x
This commit is contained in:
+1
-1
@@ -453,7 +453,7 @@ public final class EndpointRequest {
|
||||
.filter(Objects::nonNull)
|
||||
.map(this::getEndpointId)
|
||||
.flatMap((endpointId) -> streamAdditionalPaths(endpoints, endpointId))
|
||||
.map(PathPatternParserServerWebExchangeMatcher::new)
|
||||
.map((path) -> new PathPatternParserServerWebExchangeMatcher(path, this.httpMethod))
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
return (!CollectionUtils.isEmpty(delegateMatchers)) ? new OrServerWebExchangeMatcher(delegateMatchers)
|
||||
: EMPTY_MATCHER;
|
||||
|
||||
+11
@@ -311,6 +311,17 @@ class EndpointRequestTests {
|
||||
assertMatcher.matches("/additional");
|
||||
}
|
||||
|
||||
@Test
|
||||
void toAdditionalPathsWithHttpMethodShouldRespectRequestMethod() {
|
||||
ServerWebExchangeMatcher matcher = EndpointRequest
|
||||
.toAdditionalPaths(WebServerNamespace.SERVER, FooEndpoint.class)
|
||||
.withHttpMethod(HttpMethod.POST);
|
||||
RequestMatcherAssert assertMatcher = assertMatcher(matcher, new PathMappedEndpoints("",
|
||||
() -> List.of(mockEndpoint(EndpointId.of("foo"), "test", WebServerNamespace.SERVER, "/additional"))));
|
||||
assertMatcher.matches(HttpMethod.POST, "/additional");
|
||||
assertMatcher.doesNotMatch(HttpMethod.GET, "/additional");
|
||||
}
|
||||
|
||||
@Test
|
||||
void toAdditionalPathsWithEndpointClassShouldNotMatchOtherPaths() {
|
||||
ServerWebExchangeMatcher matcher = EndpointRequest.toAdditionalPaths(WebServerNamespace.SERVER,
|
||||
|
||||
Reference in New Issue
Block a user