Search in sources :

Example 1 with WriterRole

use of com.bc.pmpheep.back.po.WriterRole in project pmph by BCSquad.

the class WriterRoleServiceTest method testUpdate.

@Test
@Rollback(Const.ISROLLBACK)
public void testUpdate() {
    WriterRole writerRole = this.addWriterRole();
    int num = -1;
    WriterRole writerRole2 = new WriterRole("角色2", false, null, null, null, null);
    writerRole2.setId(writerRole.getId());
    num = writerRoleService.update(writerRole2);
    Assert.assertTrue("是否更新成功", num > 0 ? true : false);
}
Also used : WriterRole(com.bc.pmpheep.back.po.WriterRole) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Example 2 with WriterRole

use of com.bc.pmpheep.back.po.WriterRole in project pmph by BCSquad.

the class WriterRoleServiceTest method testGet.

@Test
@Rollback(Const.ISROLLBACK)
public void testGet() {
    WriterRole writerRole = this.addWriterRole();
    Assert.assertNotNull("是否查询成功", writerRoleService.get(writerRole.getId()));
}
Also used : WriterRole(com.bc.pmpheep.back.po.WriterRole) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Example 3 with WriterRole

use of com.bc.pmpheep.back.po.WriterRole in project pmph by BCSquad.

the class WriterRoleServiceTest method testGetListRole.

@Test
@Rollback(Const.ISROLLBACK)
public void testGetListRole() {
    WriterRole writerRole = this.addWriterRole();
    List<WriterRole> list = writerRoleService.getListRole(null);
    Assert.assertNotNull("是否查询成功", list);
}
Also used : WriterRole(com.bc.pmpheep.back.po.WriterRole) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Example 4 with WriterRole

use of com.bc.pmpheep.back.po.WriterRole 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);
}
Also used : WriterPermission(com.bc.pmpheep.back.po.WriterPermission) WriterRolePermission(com.bc.pmpheep.back.po.WriterRolePermission) WriterRole(com.bc.pmpheep.back.po.WriterRole) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Example 5 with WriterRole

use of com.bc.pmpheep.back.po.WriterRole in project pmph by BCSquad.

the class WriterRoleServiceTest method testDelete.

@Test
@Rollback(Const.ISROLLBACK)
public void testDelete() {
    WriterRole writerRole = this.addWriterRole();
    int num = -1;
    num = writerRoleService.delete(writerRole.getId());
    Assert.assertTrue("是否删除", num > 0 ? true : false);
}
Also used : WriterRole(com.bc.pmpheep.back.po.WriterRole) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Aggregations

WriterRole (com.bc.pmpheep.back.po.WriterRole)11 BaseTest (com.bc.pmpheep.test.BaseTest)10 Test (org.junit.Test)10 Rollback (org.springframework.test.annotation.Rollback)10 WriterUser (com.bc.pmpheep.back.po.WriterUser)2 ArrayList (java.util.ArrayList)2 WriterPermission (com.bc.pmpheep.back.po.WriterPermission)1 WriterRolePermission (com.bc.pmpheep.back.po.WriterRolePermission)1 WriterUserRole (com.bc.pmpheep.back.po.WriterUserRole)1 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedList (java.util.LinkedList)1 Map (java.util.Map)1