/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved. <a>http://www.crunii.com</a>
 */
package com.crunii.micro.api.test;

import com.crunii.micro.common.dto.PageReq;
import com.crunii.micro.service.sysmgr.dto.enc.EncryptConfigC;
import com.crunii.micro.service.sysmgr.dto.enc.EncryptConfigReq;
import com.crunii.micro.service.sysmgr.dto.enc.EncryptConfigU;
import com.crunii.micro.service.sysmgr.service.EncryptConfigService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback;

/**
 * @author 田平 create 2019年6月5日上午10:16:09
 */
public class EncryptConfigServiceTest extends SysmgrBaseTest {

	@Autowired
	private EncryptConfigService encryptConfigService;

	//@Test
	@Rollback(false)
	public void testCreate() {
		EncryptConfigC encryptConfigC = new EncryptConfigC();
		encryptConfigC.setTabName("t_xxx");
		encryptConfigC.setColName("xx_name");
		encryptConfigService.createEncryptConfig(encryptConfigC);
	}

	//@Test
	@Rollback(false)
	public void testUpdate() {
		EncryptConfigU u = new EncryptConfigU();
		u.setId(10001);
		u.setTabName("f_xxx");
		u.setColName("f_name");
		encryptConfigService.updateEncryptConfig(u);
	}

	@Test
	@Rollback(false)
	public void testPage() {
		PageReq<EncryptConfigReq> req = new PageReq<>();
		EncryptConfigReq query = new EncryptConfigReq();
		query.setTabName("f_xxx");
		req.setQuery(query);
		encryptConfigService.pageEncryptConfig(req).getResult().forEach(System.out::println);
	}

}
