测试的时候没注意,要有启动类。。。。。

springboot 之 java.lang.IllegalStateException Unable to find a @SpringBootConfiguration错误解决方案

对于2,如果要是写测试类,需要这么写

@RunWith(SpringRunner.class)
@SpringBootTest(classes = DemoApplication.class)

指定启动类

springboot 之 java.lang.IllegalStateException Unable to find a @SpringBootConfiguration错误解决方案  springboot 之 java.lang.IllegalStateException Unable to find a @SpringBootConfiguration错误解决方案

要么就得在test目录下对java目录下的文件结构。

 

相关文章:

  • 2021-04-09
  • 2021-05-14
  • 2021-08-14
  • 2021-12-03
猜你喜欢
  • 2021-10-28
  • 2022-03-03
  • 2021-10-19
  • 2021-10-24
  • 2021-08-22
  • 2021-08-12
相关资源
相似解决方案