Hi,

after upgrading to spring boot 3.2.0-RC1, my custom security filter no longer runs in tests. It seems it is simply skipped from execution. After debugging around OncePerRequestFilter:97, I found out that with RC1, the getAlreadyFilteredAttributeName() just returns .FILTERED for a number of filters instead of a unique name. With M3 everything works fine. This behaviour only occurs when running the tests, running the application "regularly" is fine too.

The issue can be reproduced with my examples project (https://github.com/bratkartoffel/security-jwt-examples) by changing the gradle.properties , springBootVersion=3.2.0-RC1and running eu.fraho.spring.example.test.regular_internal.TestRegularApplication#testPrivateWithTokenA().

Forcing the alreadyFilteredAttributeName to getClass().getName() + ALREADY_FILTERED_SUFFIX using the debugger makes the test green again. SpringBoot 3.2.0-M3 to 3.2.0-RC1 OncePerRequestFilter servlet filter names broken in tests

Thanks, Simon

Comment From: bratkartoffel

After searching more in the other spring projects i came across https://github.com/spring-projects/spring-framework/issues/31474 which seems to be my problem here. Closing, thanks

Comment From: wilkinsona

Thanks for trying the RC and for the sample that reproduces the problem. It does not occur with 3.2.0-SNAPSHOT due to the changes made for #38001.