Motivation

When enabling Spring Security MethodSecurity, I noticed that the Controller under test was not recoginized as Controller anymore in MockMvc Tests.

This provides a fix, but needs more investigation. The way I solved it is probably not ideal, and if the way is fine, it still needs refactoring. Maybe the problem is also to be found in the test setup and is considered expected behavior. I will add further information soon, but I cannot share the code causing the behavior directly. I did add a test wich seems to replicate the behavior.

I'll try to contribute over the weekend, but may only be available again on monday.

  • [ ] Checkstyle
  • [ ] All tests pass locally

Comment From: pivotal-cla

@MeneDev Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

Comment From: pivotal-cla

@MeneDev Thank you for signing the Contributor License Agreement!

Comment From: MeneDev

I realized this is expected behavior as documented under https://docs.spring.io/spring-framework/reference/6.1-SNAPSHOT/web/webmvc/mvc-controller/ann.html#mvc-ann-requestmapping-proxying