After upgrading from spring boot 3.2.0-M1 to spring boot 3.2.0-M2 @WebMvcTest is unable to bind @ControllerAdvice .
Sample code for replication , till 3.1.0-M1 it is working.
This testcase is failing though I have exception handler
Comment From: quaff
I can not reproduce it with minimal project GH-37098.zip.
Comment From: rajadilipkolli
Hi @quaff , I have modified your same sample to replicate the same. GH-37098.zip
Not sure if it is happening only when problem details is enabled
Comment From: quaff
@rajadilipkolli Actually @ControllerAdvice is picked by @WebMvcTest, and the test pass if reason of @ResponseStatus removed, I think something changed at framework not boot side caused this.
Comment From: quaff
@rajadilipkolli Actually
@ControllerAdviceis picked by@WebMvcTest, and the test pass ifreasonof@ResponseStatusremoved, I think something changed at framework not boot side caused this.
I've created https://github.com/spring-projects/spring-framework/pull/31113 to fix this.
Comment From: snicoll
Thanks very much @quaff. I am going to close this one in favor of the framework issue.
@rajadilipkolli please subscribe to https://github.com/spring-projects/spring-framework/pull/31113 for further updates.
Comment From: quaff
Thanks very much @quaff. I am going to close this one in favor of the framework issue.
@rajadilipkolli please subscribe to spring-projects/spring-framework#31113 for further updates.
@snicoll Such behavior exists over ten years, It's not likely a regression cause this problem. I think it's correct and I've created another document enhancement PR. @rajadilipkolli Please make another minimal project that indicate it's a recent regression.
Comment From: rajadilipkolli
Hi @quaff , you can use this as an example.
Comment From: quaff
Hi @quaff , you can use this as an example.
As I described in https://github.com/spring-projects/spring-framework/pull/31121, The return value of HandlerMethod will be ignored if reason of @ResponseStatus present, It is expected behavior, you could remove the reason to make your test passes.
I'm wondering there is another recent changes cause the regression.