package com.blueland.ebpm.engine.config.service;

import static junit.framework.Assert.assertNotNull;
/**
 * @author lw
 * @version 1.0
 * @since  
 */


import com.blueland.bpm.engine.config.service.ActivityOperatePowerManager;
import com.blueland.ebpm.engine.BaseManagerTestCase;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;

import com.blueland.bpm.engine.config.model.ActivityOperatePower;
import org.springframework.test.context.junit4.SpringRunner;

@SpringBootTest
@RunWith(SpringRunner.class)
public class ActivityOperatePowerManagerTest extends BaseManagerTestCase {

	private ActivityOperatePowerManager manager;
	
	@Autowired
	public void setActivityOperatePowerManager(ActivityOperatePowerManager manager) {
		this.manager = manager;
	}

	//数据库单元测试前会开始事务，结束时会回滚事务，所以测试方法可以不用关心测试数据的删除
	@Test
	public void crud() {

		ActivityOperatePower obj = newActivityOperatePower();
		manager.save(obj);
		//manager.getEntityDao().flush();
		
		manager.update(obj);
		//manager.getEntityDao().flush();
		
		assertNotNull(obj.getOpId());
		
		manager.removeById(obj.getOpId());
		//manager.getEntityDao().flush();
	
	}
	
	public static ActivityOperatePower newActivityOperatePower() {
		ActivityOperatePower obj = new ActivityOperatePower();
		
	  	obj.setOpName(new String("1"));
	  	obj.setOpParentId(new String("1"));
	  	obj.setOpType(new String("1"));
	  	obj.setOpSort(new Integer("1"));
	  	obj.setOpScope(new String("1"));
	  	obj.setOpClassPath(new String("1"));
	  	obj.setOpRemark(new String("1"));
		return obj;
	}
}
