【自动化测试】基于spring框架的单元测试

package test.service.AttendanceService;

import static org.junit.Assert.assertEquals;

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 com.naton.pojo.example.ParamExample;
import com.naton.service.AttendanceService;

import base.Level;

@RunWith(SpringJUnit4ClassRunner.class)  //使用junit4进行测试  
@ContextConfiguration({"classpath:applicationContext.xml"})  
public class GetSearchAttendanceListTest  {
	
	@Autowired 
	AttendanceService attendanceService;  
    
    @Test  
    public void getSearchAttendanceListTest(){  
    	ParamExample param = new ParamExample();
    	param.setPageIndex(1);
    	param.setPageSize(20);
    	attendanceService.getSearchAttendanceList(param);
    }  
}

猜你喜欢

转载自blog.csdn.net/jack_eusong/article/details/79149629