3.5K Unstar Star 9.7K Fork 4.1K

卓源软件 / JeeSite 4.2

在jeesite Test里面引入服务,报空指针异常。jeesite中如何进行单元测试

Closed
果壳  Opened this issue

该问题是怎么引起的?

测试类中注入失败
无法进行单元测试

重现步骤

/**
 * 初始化数据表
 * @author ThinkGem
 * @version 2020-5-26
 */
@ActiveProfiles("test")
@SpringBootTest(classes=Application.class)
public class InitData {

	@Autowired
	private EmpUserService empUserService;
	@Autowired
	private AreaService areaService;
	
	@Test
	public void test1(){
		Area area = areaService.get("520000");
		System.out.println(area);
	}



}

报错信息

![注入失败]输入图片说明

6732 thinkgem 1578914432 total 2 participants

Comments (1)

6732 thinkgem 1578914432
卓源软件 2020-09-14 12:11 owner

继承 BaseSpringContextTests 类

Sign in to comment

Assignees
Labels
Not set
Projects
Milestones
Branches
Planed to start
Not set
Planed to end
Not set
Top level
Priority
Java
1
https://gitee.com/thinkgem/jeesite4.git
git@gitee.com:thinkgem/jeesite4.git
thinkgem
jeesite4
JeeSite 4.2

Search