package com.自定义.mall.admin.system; import java.util.List; import java.util.Map; import javax.annotation.Resource; import org.junit.Test; import com.zjdfwl.mall.admin.base.BaseJunit; import com.zjdfwl.mall.modular.sys.dao.SysDeptMapper; import com.zjdfwl.mall.modular.sys.model.SysDept; /** * 字典服务测试 * * @author fengshuonan * @date 2017-04-27 17:05 */ public class DeptTest extends BaseJunit { @Resource SysDeptMapper deptMapper; @Test public void addDeptTest() { SysDept dept = new SysDept(); // dept.setFullname("测试fullname"); // dept.setNum(5); // dept.setPid(1); // dept.setSimplename("测试"); // dept.setTips("测试tips"); // dept.setVersion(1); // Integer insert = deptMapper.insert(dept); // assertEquals(insert, new Integer(1)); } @Test public void updateTest() { SysDept dept = this.deptMapper.selectById(24); //dept.setTips("哈哈"); //boolean flag = dept.updateById(); //assertTrue(flag); } @Test public void deleteTest() { SysDept dept = this.deptMapper.selectById(24); //Integer integer = deptMapper.deleteById(dept); //assertTrue(integer > 0); } @Test public void listTest() { List<Map<String, Object>> list = this.deptMapper.list("总公司"); //assertTrue(list.size() > 0); } }