Skip to content

Commit 66319fc

Browse files
committed
MockServerHttpRequest.method(String,String)->method(HttpMethod,String)
Closes gh-17058
1 parent 2dbf3a2 commit 66319fc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

web/src/test/java/org/springframework/security/web/server/csrf/CsrfWebFilterTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import reactor.test.StepVerifier;
2525
import reactor.test.publisher.PublisherProbe;
2626

27+
import org.springframework.http.HttpMethod;
2728
import org.springframework.http.HttpStatus;
2829
import org.springframework.http.MediaType;
2930
import org.springframework.mock.http.server.reactive.MockServerHttpRequest;
@@ -216,7 +217,7 @@ public void filterWhenXorServerCsrfTokenRequestAttributeHandlerAndRawTokenThenAc
216217
// gh-8452
217218
public void matchesRequireCsrfProtectionWhenNonStandardHTTPMethodIsUsed() {
218219
MockServerWebExchange nonStandardHttpExchange = MockServerWebExchange
219-
.from(MockServerHttpRequest.method("non-standard-http-method", "/"));
220+
.from(MockServerHttpRequest.method(HttpMethod.valueOf("non-standard-http-method"), "/"));
220221
ServerWebExchangeMatcher serverWebExchangeMatcher = CsrfWebFilter.DEFAULT_CSRF_MATCHER;
221222
assertThat(serverWebExchangeMatcher.matches(nonStandardHttpExchange).map(MatchResult::isMatch).block())
222223
.isTrue();

0 commit comments

Comments
 (0)