Search in sources :

Example 36 with WriterUser

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

the class WriterUserServiceTest method testGetListsTest.

/**
 * 查询
 */
@Test
@Rollback(Const.ISROLLBACK)
public void testGetListsTest() {
    WriterUser writerUser = this.addWriterUser();
    // WriterUser wtUser;
    // List<WriterUser> pmUsers;
    // List<WriterPermission> listPermissions;
    // wtUser = writerUserService.login("test1", "123");
    List<WriterRole> pr = writerUserService.getListUserRole(writerUser.getId());
    Assert.assertNotNull("获取失败", pr);
}
Also used : WriterUser(com.bc.pmpheep.back.po.WriterUser) WriterRole(com.bc.pmpheep.back.po.WriterRole) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Example 37 with WriterUser

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

the class WriterUserServiceTest method testGetListRoleSnByUser.

@Test
@Rollback(Const.ISROLLBACK)
public void testGetListRoleSnByUser() {
    WriterUser writerUser = this.addWriterUser();
    List<String> listRoleNameList = writerUserService.getListRoleSnByUser(writerUser.getId());
    // 查询所有
    Assert.assertNotNull("查询失败", listRoleNameList);
}
Also used : WriterUser(com.bc.pmpheep.back.po.WriterUser) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Example 38 with WriterUser

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

the class WriterUserServiceTest method testDelete.

@Test
@Rollback(Const.ISROLLBACK)
public void testDelete() {
    WriterRole WriterRole = this.addWriterRole();
    WriterUser writerUser = writerUserService.add(new WriterUser("test1", "123"));
    WriterUserRole writerUserRole = writerUserRoleService.addWriterUserRole(new WriterUserRole(writerUser.getId(), WriterRole.getId()));
    List<Long> userIdList = new ArrayList<Long>();
    userIdList.add(writerUserRole.getId());
    Assert.assertTrue("是否删除成功", writerUserService.deleteUserAndRole(userIdList) > 0 ? true : false);
}
Also used : WriterUserRole(com.bc.pmpheep.back.po.WriterUserRole) ArrayList(java.util.ArrayList) WriterUser(com.bc.pmpheep.back.po.WriterUser) WriterRole(com.bc.pmpheep.back.po.WriterRole) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Example 39 with WriterUser

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

the class WriterUserServiceTest method testUpdate.

@Test
@Rollback(Const.ISROLLBACK)
public void testUpdate() {
    WriterUser writerUser = this.addWriterUser();
    List<Long> userIdList = new ArrayList<Long>();
    userIdList.add(1L);
    userIdList.add(2L);
    writerUser.setRealname("姓名");
    writerUser.setPassword("1234");
    WriterUser pu1 = writerUserService.update(writerUser, userIdList);
    Assert.assertNotNull("是否更新成功", pu1);
}
Also used : ArrayList(java.util.ArrayList) WriterUser(com.bc.pmpheep.back.po.WriterUser) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Example 40 with WriterUser

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

the class WriterUserServiceTest method testGetList.

@Test
@Rollback(Const.ISROLLBACK)
public void testGetList() {
    WriterUser writerUser = this.addWriterUser();
    Assert.assertNotNull("查询失败", writerUserService.getList());
    // 查询所有
    ;
}
Also used : WriterUser(com.bc.pmpheep.back.po.WriterUser) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Aggregations

WriterUser (com.bc.pmpheep.back.po.WriterUser)49 BaseTest (com.bc.pmpheep.test.BaseTest)26 Test (org.junit.Test)26 Rollback (org.springframework.test.annotation.Rollback)24 CheckedServiceException (com.bc.pmpheep.service.exception.CheckedServiceException)17 ArrayList (java.util.ArrayList)14 PmphUser (com.bc.pmpheep.back.po.PmphUser)11 UserMessage (com.bc.pmpheep.back.po.UserMessage)7 OrgUser (com.bc.pmpheep.back.po.OrgUser)6 WebScocketMessage (com.bc.pmpheep.websocket.WebScocketMessage)6 DesRun (com.bc.pmpheep.back.util.DesRun)4 Message (com.bc.pmpheep.general.po.Message)4 HashMap (java.util.HashMap)4 PageResult (com.bc.pmpheep.back.plugin.PageResult)3 MyMessageVO (com.bc.pmpheep.back.vo.MyMessageVO)3 PageParameter (com.bc.pmpheep.back.plugin.PageParameter)2 Material (com.bc.pmpheep.back.po.Material)2 MessageAttachment (com.bc.pmpheep.back.po.MessageAttachment)2 Org (com.bc.pmpheep.back.po.Org)2 PmphRole (com.bc.pmpheep.back.po.PmphRole)2