一 详细异常提示
java.lang.IllegalStateException: Configuration error: found multiple declarations of @BootstrapWith for test class [com.xbook.web.controller.CartControllerTest]: [@org.springframework.test.context.BootstrapWith(value=org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTestContextBootstrapper.class), @org.springframework.test.context.BootstrapWith(value=org.springframework.boot.test.context.SpringBootTestContextBootstrapper.class)]
二 解决方法
在测试类中发现了多个@BootstrapWith注解的声明,导致了IllegalStateException。文章提供了详细的错误解析和解决方法,包括调整SpringBoot的测试配置,确保正确使用WebMvcTest或@SpringBootTest。
https://blog.youkuaiyun.com/yangyangrenren/article/details/118075295
5万+

被折叠的 条评论
为什么被折叠?



