@ContextConfiguration的依赖
时间: 2023-10-19 14:33:11 浏览: 93
测试需要的jar包.zip
ContextConfiguration注解的依赖是Spring Framework的spring-test模块。可以在pom.xml文件中添加以下依赖来使用@ContextConfiguration注解:
```
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>版本号</version>
<scope>test</scope>
</dependency>
```
其中,版本号需要根据你项目中已经使用的Spring Framework版本进行设置。通过添加这个依赖,你就可以在Junit测试中使用@ContextConfiguration注解来加载Spring的配置文件或注解配置。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [spring-context注解系列四——@Configuration](https://blog.csdn.net/zhouli41902/article/details/117997913)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [spring的@ContextConfiguration注解](https://blog.csdn.net/sdmanooo/article/details/112871452)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [JdbcTemplateTool.zip](https://download.csdn.net/download/weixin_39841856/11386694)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文