Search in sources :

Example 46 with WriterUser

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

the class WriterUserTest method testAddWriterUserOfBack.

/**
 * 后台添加作家用户
 */
@Test
@Rollback(Const.ISROLLBACK)
public void testAddWriterUserOfBack() {
    WriterUser writerUser = this.addWriterUser();
    writerUser.setUsername("zuojiayonghu");
    writerUser.setNickname("昵称");
    writerUser.setHandphone("13488889898");
    writerUser.setEmail("123@126.com");
    Assert.assertTrue("添加失败", userService.addWriterUserOfBack(writerUser).equals("SUCCESS"));
}
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 47 with WriterUser

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

the class WriterUserTest method testAdd.

/**
 * WriterUser 添加Test
 */
@Test
@Rollback(Const.ISROLLBACK)
public void testAdd() {
    WriterUser writerUser = this.addWriterUser();
    Assert.assertNotNull("添加失败", 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 48 with WriterUser

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

the class WriterUserTest method testUpdateWriterUserOfBack.

/**
 * :修改作家用户
 */
@Test
@Rollback(Const.ISROLLBACK)
public void testUpdateWriterUserOfBack() {
    WriterUser writerUser = this.addWriterUser();
    writerUser.setUsername(writerUser.getUsername());
    writerUser.setRealname("姓名");
    Assert.assertNotNull("修改失败", userService.updateWriterUserOfBack(writerUser));
}
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 49 with WriterUser

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

the class WriterUserTest method testBackWriterUser.

/**
 * 查询
 */
// @Test
// @Rollback(Const.ISROLLBACK)
// public void testGetLists() {
// WriterUser wtUser;
// List<WriterUser> wtUsers;
// List<WriterPermission> listPermissions;
// wtUsers = userService.getList();// 查询所有
// Assert.assertNotNull(wtUsers);
// wtUser = userService.getByUsernameAndPassword("test1", ShiroKit.md5("123", "test1"));//
// 按UserName
// Assert.assertNotNull(wtUser);
// wtUser = userService.get(1L);// 按ID查询对象
// Assert.assertNotNull(wtUser);
// wtUser = userService.login("test1", "123");
// Assert.assertNotNull(wtUser);
// wtUsers = userService.getListByRole(1L);
// Assert.assertNotNull(wtUsers);
// listPermissions = userService.getListAllResource(1L);
// Assert.assertNotNull(listPermissions);
// List<String> listRoleNameList = userService.getListRoleSnByUser(1L);
// Assert.assertNotNull(listRoleNameList);
// List<WriterRole> pr = userService.getListUserRole(1L);
// Assert.assertNotNull(pr);
// }
/**
 * writerUser 更新方法
 */
// @Test
// @Rollback(Const.ISROLLBACK)
// public void testUpdatePmphUser() {
// WriterUser writerUser = new WriterUser();
// writerUser.setId(18L);
// writerUser.setUsername("admin1");
// List<Long> userIdList = new ArrayList<Long>();
// userIdList.add(1L);
// userIdList.add(2L);
// WriterUser pu = userService.update(writerUser);
// Assert.assertNotNull(pu);
// WriterUser pu1 = userService.update(writerUser, userIdList);
// Assert.assertNotNull(pu1);
// }
/**
 * 功能描述:作家用户管理页面的单元测试
 */
@Test
@Rollback(Const.ISROLLBACK)
public void testBackWriterUser() {
    WriterUser writerUser = this.addWriterUser();
    // PageParameter<GroupMemberWriterUserVO> pageParameter = new PageParameter<>(1,
    // 20);
    // GroupMemberWriterUserVO groupMemberWriterUserVO = new
    // GroupMemberWriterUserVO();
    // groupMemberWriterUserVO.setBookname(null);
    // groupMemberWriterUserVO.setChosenPosition(null);
    // groupMemberWriterUserVO.setName(null);
    // pageParameter.setParameter(groupMemberWriterUserVO);
    // PageResult<GroupMemberWriterUserVO> pageResult =
    // userService.listGroupMemberWriterUsers(pageParameter);
    // Assert.assertNotNull(pageResult);
    // logger.debug(pageResult.toString());
    PageParameter<WriterUserManagerVO> pageParameter2 = new PageParameter<>();
    WriterUserManagerVO writerUserManagerVO = new WriterUserManagerVO();
    writerUserManagerVO.setName(null);
    writerUserManagerVO.setOrgName(null);
    writerUserManagerVO.setRank(null);
    pageParameter2.setPageNumber(1);
    pageParameter2.setPageSize(20);
    pageParameter2.setParameter(writerUserManagerVO);
    PageResult<WriterUserManagerVO> pageResult2 = userService.getListWriterUser(pageParameter2, null);
    Assert.assertNotNull(pageResult2);
}
Also used : WriterUserManagerVO(com.bc.pmpheep.back.vo.WriterUserManagerVO) PageParameter(com.bc.pmpheep.back.plugin.PageParameter) 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