如果只是为了查看springboot的版本等公共方法,直接在classes加上当前类

@SpringBootTest(classes = xxx.class)

经典解读:

springboot单元测试Unable to find a @SpringBootConfiguration的两种解决方法以及原理 - 简书

SpringBoot Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration_金字塔的旅行的博客-CSDN博客

SpringBoot测试失败并报错: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration_垃圾王子晗的博客-CSDN博客

SpringBoot Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration相关推荐

  1. SpringBoot测试失败并报错: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration

    情况一: 该测试类在测试包test下的包名和类路径java下的包名不一致导致的,修改包名一致即可 由于包名自动生成的缘故导致这两个包名不一致,引发以下报错 java.lang.IllegalState ...

  2. SpringBoot Unable to find a @SpringBootConfiguration, you need to use....

    错误原因 启动项与test不在同级根目录下 解决办法 将启动项与test各自放到相同根目录下

  3. 解决SpringBoot测试时出现:Unable to find a @SpringBootConfiguration,you need to use @ContextConfiguration

     在测试类中找不到带有@SpringBootApplication的启动类.  运行TestMy类的test1()方法,报错.并且book出现了红色下划线.  解决.将测试类的路径和Applicati ...

  4. java.lang.IllegalStateException Unable to find a @SpringBootConfiguration错误解决方案(亲测)

    问题描述: java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @C ...

  5. Spring 测试运行的时候提示 Unable to find a @SpringBootConfiguration 错误

    Spring 进行测试的时候提示的错误信息如下: SEVERE: Caught exception while closing extension context: org.junit.jupiter ...

  6. Spring Boot——[java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration]解决方案

    问题描述 问题分析 没在根目录下写一个Spring Boot的启动类. 解决方案 方案一:Class 在根目录下写一个Spring Boot的启动类. 方案二:注解  需要在注解上加上 @Spring ...

  7. java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @Contex

    报这个错,是因为测试包名和项目包名不一致导致的.

  8. SpringBoot: Unable to start LiveReload server(热部署问题已解决)

    问题背景 依旧是部署springcloud项目时出现的报错. 问题原因 1.多个项目开启导致热部署端口冲突 2.热部署依赖和其他引入依赖冲突 问题解决 在application.yml文件里修改热部署 ...

  9. SpringBoot系列: 单元测试

    SpringBoot 项目单元测试也很方便, Web项目中单元测试应该覆盖: 1. Service 层 2. Controller 层 本文前半部分讲解是一些测试基础配置. 对于Service和Con ...

最新文章

  1. qstring 属于元数据类型吗_数据仓库的“元数据管理”
  2. JavaScript 技术篇-js代码获取当前操作系统信息、浏览器版本信息实例演示,windows NT版本对照表
  3. django构建网页_通过解决问题的方式学习django,律师如何构建副业
  4. netdev: dev_watchdog timer(结合stmmac 分析)
  5. python集合常用方法_Python中集合类型(set)学习小结
  6. 杭电 hdu 2019
  7. 12_第一个Flutter程序
  8. soapUI(groovy脚本作用2)请不要问为什么系列2
  9. Word没有到一行自动换行如何解决
  10. Aliplayer自定义组件
  11. Unity粒子特效系列-龙卷风预制体做好了,unitypackage包直接用!
  12. 2022.02.10
  13. android高仿苹果计算器,安卓仿苹果计算器(内附完整源码)要点解析.docx
  14. 2021年幼儿园教师招聘:小班梳子画《小草》
  15. 有哪些好的编程习惯从一开始就值得坚持?
  16. 数据安全态势感知解决方案汇总
  17. 射频信号源及射频信号测试接口案例-纳米软件
  18. 如何利用ewomail搭建邮件服务器
  19. 工程图学及计算机绘图宋卫卫,工程图学及计算机绘图习题集
  20. IBM Thinkpad的感动,十五岁的生日

热门文章

  1. 宝宝生活点滴(2009.12)
  2. 雅虎将面临史上最严重危机:董事会或将解散
  3. 为什么现在的手机越来越重,越来越厚了?
  4. Python绘图实例4:正五边形绘制
  5. python语音转文字_Python文字转语音示例
  6. C++ 检测程序是否在运行
  7. items中多个checkgroup在IE6下无法完整显示
  8. 微软CEO鲍尔默失策太多次 应只拿1美元年薪
  9. 分数的计算机应用教案,2015级大学计算机应用基础教学大纲
  10. 高压MOS管KNX42150 1500V/3A 应用于变频器电源-逆变器等