Search in sources :

Example 41 with WriterUser

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

the class WriterUserServiceTest method testGet.

@Test
public void testGet() {
    WriterUser writerUser = this.addWriterUser();
    WriterUser writerUser1 = new WriterUser();
    writerUser1.setRealname("姓名");
    writerUser1 = writerUserService.get(writerUser.getId());
    Assert.assertNotNull("是否查询成功", writerUser1);
}
Also used : WriterUser(com.bc.pmpheep.back.po.WriterUser) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest)

Example 42 with WriterUser

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

the class WriterUserServiceTest method testGetWriterUserListByOrgIds.

@Test
@Rollback(Const.ISROLLBACK)
public void testGetWriterUserListByOrgIds() {
    WriterUser writerUser = writerUserService.add(new WriterUser("test00", "123", false, 1L, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, false, null, null, null, null, false, false, null, null, null, null, false, null, null));
    List<Long> orgIds = new ArrayList<Long>();
    orgIds.add(writerUser.getOrgId());
    List<WriterUser> list = writerUserService.getWriterUserListByOrgIds(orgIds);
    Assert.assertTrue("获取数据失败", list.size() > 0);
}
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 43 with WriterUser

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

the class WriterUserServiceTest method testDeleteWriterUserServiceById.

@Test
@Rollback(Const.ISROLLBACK)
public void testDeleteWriterUserServiceById() {
    WriterUser writerUser = this.addWriterUser();
    Assert.assertNotNull("删除失败", writerUserService.delete(writerUser.getId()));
}
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 44 with WriterUser

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

the class WriterUserServiceTest method testDeletePmphUserTest.

/**
 * PmphUser 添加删除
 */
@Test
@Rollback(Const.ISROLLBACK)
public void testDeletePmphUserTest() {
    WriterUser writerUser = this.addWriterUser();
    Assert.assertTrue("删除失败", writerUserService.delete(writerUser.getId()) > 0);
}
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 45 with WriterUser

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

the class WriterUserTest method testAddList.

@Test
@Rollback(Const.ISROLLBACK)
public void testAddList() {
    WriterUser writerUser = this.addWriterUser();
    List<Long> allList = new ArrayList<>();
    allList.add(1L);
    allList.add(1L);
    allList.add(2L);
    allList.add(3L);
    // 给单用户添加多个角色
    WriterUser ps = userService.add(new WriterUser("test1", "123"), allList);
    Assert.assertNotNull(ps);
}
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)

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