springboot junit 单元测试 报 Unable to find a @SpringBootConfiguration, you need to use @Context

错误详细:java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @Context 解决办法一 因为测试类所在包和springboot主启动类不在同一目录下导致,可以把测试类放在和springboot主启动类同一包下。 解决办法二 修改目录结构如图 把刚创建的包设置为Te
相关文章
相关标签/搜索