博客详情

spring4的junit test (原创)

作者: 朝如青丝暮成雪
发布时间:2021-10-22 15:19:47  文章分类:java编程   阅读(645)  评论(0)

pom中引入依赖:

     <dependency>

            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>4.3.20.RELEASE</version>

        </dependency>



java 测试代码;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath:spring.xml"})
public class SpringActTest01 {

    @Autowired
    private XxxService xxxService;

    @Test
    public void test1(){
       //...
    }


}




关键字:  无
评论信息
暂无评论
发表评论

亲,您还没有登陆,暂不能评论哦! 去 登陆 | 注册

博主信息
   
数据加载中,请稍候...
文章分类
   
数据加载中,请稍候...
阅读排行
 
数据加载中,请稍候...
评论排行
 
数据加载中,请稍候...

Copyright © 叮叮声的奶酪 版权所有
备案号:鄂ICP备17018671号-1

鄂公网安备 42011102000739号