From 9d91dbc4e577a6a0595af9749227c7475d27e425 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 18 Jul 2023 10:31:41 +0100 Subject: [PATCH] Use explicit matchers following Spring Security 6.0.5 upgrade See gh-36293 --- .../actuator/customsecurity/SecurityConfiguration.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/src/main/java/smoketest/actuator/customsecurity/SecurityConfiguration.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/src/main/java/smoketest/actuator/customsecurity/SecurityConfiguration.java index 5b7b1f266a..65f8e7bb3c 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/src/main/java/smoketest/actuator/customsecurity/SecurityConfiguration.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/src/main/java/smoketest/actuator/customsecurity/SecurityConfiguration.java @@ -66,8 +66,8 @@ public class SecurityConfiguration { requests.requestMatchers(EndpointRequest.toAnyEndpoint().excluding(MappingsEndpoint.class)) .hasRole("ACTUATOR"); requests.requestMatchers(PathRequest.toStaticResources().atCommonLocations()).permitAll(); - requests.requestMatchers("/foo").permitAll(); - requests.requestMatchers(new AntPathRequestMatcher("/error")).permitAll(); + requests.requestMatchers(new AntPathRequestMatcher("/foo")).permitAll(); + requests.requestMatchers(new MvcRequestMatcher(handlerMappingIntrospector, "/error")).permitAll(); requests.requestMatchers(new AntPathRequestMatcher("/**")).hasRole("USER"); }); http.cors(Customizer.withDefaults());