springbootconfiguration专题

@SpringBootConfiguration 注解的作用

1.@SpringBootApplication包括:@SpringBootConfiguration@EnableAutoConfiguration@ComponontScan2.@SpringBootConfiguration 标注这个类是一个配置类;它只是@Configuration注解的派生注解;它与@Configuration注解的功能一致;只不过@SpringBootConfigur

java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration

springboot单元测试时报错: java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with your test 解决办法:  测试类要和SpringBo

ava.lang.IllegalStateException: Unable to find a @SpringBootConfiguration,

文章目录 报错信息:错误的原因:解决办法: 报错信息: 在单元测试的时候报:java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with y