Search in sources :

Example 6 with WriterUserRole

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

the class WriterUserRoleServiceTest method testUpdateWriterUserRole.

@Test
@Rollback(Const.ISROLLBACK)
public void testUpdateWriterUserRole() {
    WriterUserRole writerUserRole = this.addWriterUserRole();
    writerUserRole.setRoleId(3L);
    writerUserRole.setUserId(4L);
    Integer aInteger = testService.updateWriterUserRole(writerUserRole);
    Assert.assertTrue("是否修改成功", aInteger > 0 ? true : false);
}
Also used : WriterUserRole(com.bc.pmpheep.back.po.WriterUserRole) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Example 7 with WriterUserRole

use of com.bc.pmpheep.back.po.WriterUserRole 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)

Aggregations

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