use of com.bc.pmpheep.back.po.WriterPermission in project pmph by BCSquad.
the class WriterPermissionServiceTest method getPmphPermissionTest.
/**
* PmphPermission 查询Test
*/
@Test
@Rollback(Const.ISROLLBACK)
public void getPmphPermissionTest() {
WriterPermission pp = new WriterPermission();
pp.setMenuName("用户管理4");
pp.setUrl("admin/user/add");
pp.setPermissionName("用户管理添加");
pp.setPath("admin:add");
pp.setParentId(4L);
writerPermissionService.addWriterPermission(pp);
pp.setId(pp.getId());
Assert.assertNotNull("getWriterPermissionByPermissionName是否为空", // 按ID查询资源
writerPermissionService.getWriterPermissionByPermissionName("用户管理添加"));
Assert.assertNotNull("get是否为空", writerPermissionService.get(pp.getId()));
// 查询所有资源
Assert.assertNotNull("getListResource是否为空", writerPermissionService.getListResource());
// Assert.assertNotNull("WriterPermission是否为空", writerPermissionService.getListAllParentMenu());
// Assert.assertNotNull("WriterPermissionByParentId是否为空", writerPermissionService.getListChildMenuByParentId(0L));
}
use of com.bc.pmpheep.back.po.WriterPermission in project pmph by BCSquad.
the class WriterPermissionServiceTest method updatePmphPermissionTest.
/**
* PmphPermission 更新Test
*/
@Test
@Rollback(Const.ISROLLBACK)
public void updatePmphPermissionTest() {
WriterPermission pp = new WriterPermission();
pp.setMenuName("用户管理2");
pp.setUrl("admin/user/add");
pp.setPermissionName("用户管理添加2");
pp.setPath("admin:add");
pp.setParentId(2L);
writerPermissionService.addWriterPermission(pp);
pp.setId(pp.getId());
pp.setMenuName("用户管理2");
// 按ID更新资源目录
Integer aInteger = writerPermissionService.updateWriterPermissionById(pp);
Assert.assertTrue("是否更新成功", aInteger > 0 ? true : false);
}
use of com.bc.pmpheep.back.po.WriterPermission in project pmph by BCSquad.
the class WriterPermissionServiceTest method deletePmphPermissionTest.
/**
* PmphPermission 删除Test
*/
@Test
@Rollback(Const.ISROLLBACK)
public void deletePmphPermissionTest() {
WriterPermission pp = new WriterPermission();
pp.setMenuName("用户管理3");
pp.setUrl("admin/user/add");
pp.setPermissionName("用户管理添加3");
pp.setPath("admin:add");
pp.setParentId(3L);
writerPermissionService.addWriterPermission(pp);
pp.setId(pp.getId());
// String[] ids = { "2L" };
// 按ID删除资源
Integer aInteger = writerPermissionService.delete(pp.getId());
Assert.assertTrue("delete是否删除成功", aInteger > 0 ? true : false);
// Integer bInteger = writerPermissionService.deleteWriterPermissionById(ids);
// Assert.assertTrue("deleteWriterPermissionById是否删除成功", bInteger > 0 ? true : false);
}
use of com.bc.pmpheep.back.po.WriterPermission in project pmph by BCSquad.
the class WriterRoleServiceTest method testGetListRoleResource.
@Test
@Rollback(Const.ISROLLBACK)
public void testGetListRoleResource() {
WriterRole writerRole = this.addWriterRole();
List<WriterPermission> list = writerRoleService.getListRoleResource(writerRole.getId());
Assert.assertNotNull("是否查询成功", list);
List<WriterRolePermission> list1 = writerRoleService.getListWriterRolePermission(writerRole.getId());
Assert.assertNotNull("是否查询成功", list1);
List<Long> ids = writerRoleService.getListPmphWriterPermissionIdByRoleId(writerRole.getId());
Assert.assertNotNull("是否查询成功", ids);
}
use of com.bc.pmpheep.back.po.WriterPermission in project pmph by BCSquad.
the class WriterUserServiceTest method testGetListAllResource.
@Test
@Rollback(Const.ISROLLBACK)
public void testGetListAllResource() {
WriterUser writerUser = this.addWriterUser();
Integer writerPermission = writerPermissionService.addWriterPermission(new WriterPermission(2L, "PATH", "name", "menu_name", "url", false, null, null, null, null));
// 查询所有
Assert.assertNotNull("查询失败", writerUserService.getListAllResource(writerUser.getId()));
}
Aggregations