Figured it out eventually. The company uses a complicated system of profiles, and the profile used for tests contains a (well-hidden) spring.main.web-application-type: none. Which earlier did not prevent MockMVC from autowiring somehow. But now this property is parsed correctly, and the application is not considered a web application, so no WebApplicationContext, so no MockMVCs. The solution is to set type to servlet.