Search in sources :

Example 26 with Message

use of com.bc.pmpheep.general.po.Message in project pmph by BCSquad.

the class MessageServiceTest method get.

@Test
@SuppressWarnings("deprecation")
public void get() {
    Message message = new Message(str);
    Message msg = messageService.add(message);
    Assert.assertNotNull("插入消息后返回的Message.id不应为空", msg.getId());
    message = messageService.get(msg.getId());
    messageService.removeAll();
    Assert.assertTrue("获取到的消息内容和插入时不一致", str.equals(message.getContent()));
}
Also used : Message(com.bc.pmpheep.general.po.Message) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest)

Example 27 with Message

use of com.bc.pmpheep.general.po.Message in project pmph by BCSquad.

the class MessageServiceTest method update.

@Test
@SuppressWarnings("deprecation")
public void update() {
    Message message = new Message(str);
    Message msg = messageService.add(message);
    Assert.assertNotNull("插入消息后返回的Message.id不应为空", msg.getId());
    msg.setContent("Do you LOVE me?");
    messageService.update(msg);
    message = messageService.get(msg.getId());
    messageService.removeAll();
    logger.info("更新后的Message对象 id={}, content={}", message.getId(), message.getContent());
    Assert.assertTrue("更新后的消息内容不正确", msg.getContent().equals(message.getContent()));
}
Also used : Message(com.bc.pmpheep.general.po.Message) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest)

Aggregations

Message (com.bc.pmpheep.general.po.Message)27 UserMessage (com.bc.pmpheep.back.po.UserMessage)21 CheckedServiceException (com.bc.pmpheep.service.exception.CheckedServiceException)20 WebScocketMessage (com.bc.pmpheep.websocket.WebScocketMessage)20 ArrayList (java.util.ArrayList)19 Declaration (com.bc.pmpheep.back.po.Declaration)7 Material (com.bc.pmpheep.back.po.Material)7 OrgUser (com.bc.pmpheep.back.po.OrgUser)7 PmphUser (com.bc.pmpheep.back.po.PmphUser)6 WriterUser (com.bc.pmpheep.back.po.WriterUser)5 BaseTest (com.bc.pmpheep.test.BaseTest)4 Test (org.junit.Test)4 MessageAttachment (com.bc.pmpheep.back.po.MessageAttachment)3 PmphGroup (com.bc.pmpheep.back.po.PmphGroup)3 Textbook (com.bc.pmpheep.back.po.Textbook)3 PageResult (com.bc.pmpheep.back.plugin.PageResult)2 CmsContent (com.bc.pmpheep.back.po.CmsContent)2 DecPosition (com.bc.pmpheep.back.po.DecPosition)2 DecPositionPublished (com.bc.pmpheep.back.po.DecPositionPublished)2 MyMessageVO (com.bc.pmpheep.back.vo.MyMessageVO)2