spring整合junit

来源:互联网 发布:销售网络评价与改进 编辑:程序博客网 时间:2024/06/10 09:16

只需在测试类上加上这两个注解,即可在测试类中使用@Autowired注入对象。
注:配置文件路径根据自身情况更改

@RunWith(SpringJUnit4ClassRunner.class)@ContextConfiguration(locations = { "classpath:config/applicationContext.xml" })
原创粉丝点击