Improve diagnostics for missing ServletContext - #51425
Conversation
Signed-off-by: itaekyung <taeyun1411@gmail.com>
ccffb89 to
9e8ab3c
Compare
wilkinsona
left a comment
There was a problem hiding this comment.
Thanks for the proposal. As the test demonstrates, the analysis will kick in even when the test's configuration isn't using @EnableWebMvc. This results in a misleading action for correcting the problem.
Signed-off-by: xoruddl <taeyun1411@gmail.com>
|
Thank you for the feedback. You are right that relying only on the exception message and bean name could result in misleading guidance. I have updated the analyzer so that it is loaded from I have replaced the synthetic integration test with one that reproduces the failure using Thank you again for pointing this out. Please let me know if you think another approach would be preferable. |
Improves the diagnostics when Spring MVC resource handling is configured without a ServletContext.
The new failure analyzer detects a failed
resourceHandlerMappingwith aNo ServletContext setcause and advises removing@EnableWebMvcfrom a test slice configuration or using@WebMvcTest.Includes unit and integration tests for the analyzer.
Fixes #16936