Closed edeandrea closed 6 years ago
Thanks for the report. Can you please describe how your tests are now failing? It would also be valuable to see your test that is failing. Are you using MockMvc by chance? If so it might be related to https://jira.spring.io/browse/SPR-16097
I put together an entire sample project which demonstrates this issue:
https://github.com/edeandrea/spring-boot-upgrade-issue
The README.md file thats there details the tests and how to switch back to Spring Boot 1.5.9 fixes the tests.
Note that the code & configuration there has been "dumbed down" to show a simplistic example. In reality our actual code/classes are far more complicated & the security configuration is far more complicated. I tried to obfuscate my company's project with as little as possible needed to demonstrate this particular issue.
Thanks for the sample project. The reason is because you are using Spring Security's MVC matcher which now requires the HandlerMappingIntrospector
Bean that Spring MVC exposes. Since your test did not import Spring MVC configuration, it was failing. It is unfortuante that this broke passivity, but it was done to help ensure that a misconfiguration does not occur (which your test had).
You can find a Pull Request to fix the issue at https://github.com/edeandrea/spring-boot-upgrade-issue/pull/1
I'm closing this as invalid. Please reopen if you still believe there to be an issue.
Thank you @rwinch I will take a look on Monday when I get back to work. I appreciate the fast response! Have a great weekend!
I verified this fix works in my project. Thanks again for the help!
Glad to hear it! I'm glad to hear that this solved your issue. Thanks for the fast follow up :)
I've been working on a project where I just moved from Spring Boot 1.5.9 to 1.5.10 (which also upgraded spring-webmvc from 4.3.13 to 4.3.14 and spring-security from 4.2.3 to 4.2.4 and am getting
Unlike the examples described in https://jira.spring.io/browse/SPR-16301 I don't have any initializers or anything like that, nor do I have any classes that use
@EnableWebMvc
or that implementWebMvcConfigurer
.I'm actually seeing this issue in some unit tests where I am testing my security configuration. I am trying to test a filter thats part of the
springSecurityFilterChain
. I am building a library that is used by applications. Upgrading our reference application from 1.5.9 to 1.5.10 seems to be fine, but our unit tests for our library are now failing.My test class simply uses
at the class level and then a nested inner Config class:
The
SomeCustomAutoConfigurationClass
just does a component scan of some of our library classes and also has an@ConfigurationProperties
annotation.The
SomeCustomSecurityAutoConfigurationClass
class has the@EnableWebSecurity
annotation as well as it extendsWebSecurityConfigurerAdapter
.I've tried a number of different things, including manually defining the
mvcHandlerMappingIntrospector
bean in my configuration but nothing seems to work.Any help would be appreciated!