package com.bcxin.ars.dao.sb;

import com.alibaba.fastjson.JSON;
import com.bcxin.ars.dto.page.PerconUnRegDto;
import com.bcxin.ars.dto.page.PersonPageSearchDto;
import com.com.bcxin.ars.com.abcxin.smart.core.web.validate.AjaxPageResponse;
import org.junit.Assert;
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.transaction.TransactionConfiguration;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:/ars-dao.xml" })
@Transactional
@TransactionConfiguration(transactionManager = "txManager", defaultRollback = true)
public class PersoncertificateDaoTest {

	@Autowired
	private PersoncertificateDao personcertificateDao;
	
	@Test
	public void searchUnRegisterForPage(){
		PersonPageSearchDto dto = new PersonPageSearchDto();
		dto.setCompanyId("616638043800993792");
        //dto.setKeyword("15");
        //dto.setPersonType("2");
        dto.setInit("");
        //dto.setIdentityAuthState("1");
		AjaxPageResponse<PerconUnRegDto> page = new AjaxPageResponse<>();
		page.setPagination(true);
		page.setPageSize(20);
		page.setPageNumber(1);
        List<PerconUnRegDto> list = personcertificateDao.searchUnRegisterForPage(dto, page);
        System.out.println(JSON.toJSONString(list));
        System.out.println(list.size());
        Assert.assertNotNull(list);
	}

}
