I am updating from spring-boot 1.5.4 to spring-boot 2.2.4. After migrating my JUnitss started breaking for ContentNegotiatingViewResolver.
I have the following functionality.
1. Download the CSV / xls file.
2. For this, we have used ContentNegotiatingViewResolver. Hence, we can make the following HTTP request
http://localhost:8080/myapp/download.xls
http://localhost:8080/myapp/download.csv
3. based on file extension present in URL, the appropriate view is resolved and file with required extension is responded.
This is working as expected with sprint-boot 1.5.4. But after migration, my unit tests are failing to return HTTP 404 status.
But, after the upgrade, if I annotated my class implementing WebMvcConfigurer with @EnableWebMvc unit tests are able to detect the above URLs. Even the same behavior is observed when application is running the upgrade.
Not sure, if @EnableWebMvc is mandatory for classes implementing WebMvcConfigurer or it is an issue with Spring - boot 2.2.4 i.e. with spring 5.
Please guide me.
Comment From: rstoyanchev
Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use the issue tracker only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.
Comment From: rstoyanchev
In addition for an upgrade you should review the release notes and migration notes. It's possible that you did but you did not mention it. Generally, it's a good idea to determine if something is expected or not by reviewing the available information, before creating an issue. In your case it's probably related to the following migration note.