Spring 基础知识点记录
条评论@ContextConfiguration
注解引入 Spring 配置文件,通过value只能引用XML配置文件
@ContextConfiguration(value= [“classpath:chapter3-config.xml”])
@ContextConfiguration(classes = [Cha3Config::class])
在Spring5中 @SpringJUnitConfig
注解代替 @ExtendWith(SpringExtension::class)
和 @ContextConfiguration(classes = [Cha3Config::class])
, 但是在引用配置文件时需要使用value属性而不是classes,即 @SpringJUnitConfig(value = [Cha3Config::class])
- 本文链接:https://blog.charjin.top/2020/01/22/spring-basics/
- 版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 CN 许可协议。转载请注明出处!
分享