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 177ceb0c47..de982109e2 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 @@ -67,8 +67,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(withDefaults());