After upgrading the project to spring boot 3.0.0-M5 and running native tests it is failing with below error. Expectation that it should work without any configuration
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer$TestRestTemplateRegistrar': Runtime reflection is not supported for org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer$TestRestTemplateRegistrar()
For more info about error logs
Sample to reproduce the issue
Comment From: wilkinsona
Thanks, @rajadilipkolli. The problem appears to be due to @SpringBootTest with a non-mock web environment. As you're using MockMvc anyway, you could avoid the problem for now by using @SpringBootTest rather than @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT).
Comment From: philwebb
We'll use the simple if fix for now and raise a Framework issue to see if we can improve the situation later.