springboot test 报错解决办法:Unable to find a @SpringBootConfiguration, you need to use @Context

包名

保证test下的包路径和项目下java的包路径相同

在这里插入图片描述

在java路径下放置一个Application

/**
 * 提供给springboot test使用
 * @author humorchen
 * @date 2022/7/27 10:31
 */
@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}


在这里插入图片描述

posted @ 2022-07-27 10:58  HumorChen99  阅读(0)  评论(0编辑  收藏  举报  来源