Browse Source

Use PathPatternRequestMatcher in test

Issue gh-16887
pull/17322/head
Josh Cummings 6 months ago
parent
commit
e9506776f1
No known key found for this signature in database
GPG Key ID: 869B37A20E876129
  1. 4
      test/src/test/java/org/springframework/security/test/web/support/WebTestUtilsTests.java

4
test/src/test/java/org/springframework/security/test/web/support/WebTestUtilsTests.java

@ -41,13 +41,13 @@ import org.springframework.security.web.context.SecurityContextRepository; @@ -41,13 +41,13 @@ import org.springframework.security.web.context.SecurityContextRepository;
import org.springframework.security.web.csrf.CsrfFilter;
import org.springframework.security.web.csrf.CsrfTokenRepository;
import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import org.springframework.security.web.util.matcher.AnyRequestMatcher;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.springframework.security.web.servlet.util.matcher.PathPatternRequestMatcher.pathPattern;
@ExtendWith(MockitoExtension.class)
public class WebTestUtilsTests {
@ -226,7 +226,7 @@ public class WebTestUtilsTests { @@ -226,7 +226,7 @@ public class WebTestUtilsTests {
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
// @formatter:off
http
.securityMatcher(new AntPathRequestMatcher("/willnotmatchthis"));
.securityMatcher(pathPattern("/willnotmatchthis"));
return http.build();
// @formatter:on
}

Loading…
Cancel
Save