Przeglądaj źródła

Use PathPatternRequestMatcher in test

Issue gh-16887
Josh Cummings 1 miesiąc temu
rodzic
commit
e9506776f1

+ 2 - 2
test/src/test/java/org/springframework/security/test/web/support/WebTestUtilsTests.java

@@ -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 {
 		SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
 			// @formatter:off
 			http
-				.securityMatcher(new AntPathRequestMatcher("/willnotmatchthis"));
+				.securityMatcher(pathPattern("/willnotmatchthis"));
 			return http.build();
 			// @formatter:on
 		}