package com.djcps.server.address.area.service; import com.djcps.server.address.area.model.Area; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import java.util.List; import static org.junit.Assert.*; /** * Create by szw on 2017/11/20 14:50 */ import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {"classpath:config/spring/spring*.xml"}) public class AreaServiceTest extends AbstractJUnit4SpringContextTests { @Autowired AreaService areaService; @Test public void findProvince() throws Exception { List<Area> province = areaService.findProvince(0); System.out.println(province); } }
IDEA的Springmvc单元测试
最新推荐文章于 2020-07-18 22:05:30 发布