springmvc junit测试

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(locations={"classpath*:spring-core.xml"})
public class Test{

@Autowired
private DataMapper dataMapper;

@Test
public void testFun(){

  List<User> list = dataMapper.getUser();
  
}

}

 

posted @ 2019-05-29 11:18  javadongx  阅读(481)  评论(0编辑  收藏  举报

javadong@qq.com