Search in sources :

Example 16 with Content

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

the class ContentServiceTest method get.

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

Example 17 with Content

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

the class ContentServiceTest method update.

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

Aggregations

Content (com.bc.pmpheep.general.po.Content)17 CmsContent (com.bc.pmpheep.back.po.CmsContent)12 CheckedServiceException (com.bc.pmpheep.service.exception.CheckedServiceException)10 MaterialExtra (com.bc.pmpheep.back.po.MaterialExtra)5 Material (com.bc.pmpheep.back.po.Material)4 PmphUser (com.bc.pmpheep.back.po.PmphUser)4 BaseTest (com.bc.pmpheep.test.BaseTest)4 HashMap (java.util.HashMap)4 Test (org.junit.Test)4 MaterialContact (com.bc.pmpheep.back.po.MaterialContact)3 MaterialNoteAttachment (com.bc.pmpheep.back.po.MaterialNoteAttachment)3 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 CmsExtra (com.bc.pmpheep.back.po.CmsExtra)2 MaterialNoticeAttachment (com.bc.pmpheep.back.po.MaterialNoticeAttachment)2 Book (com.bc.pmpheep.back.po.Book)1 CmsCategory (com.bc.pmpheep.back.po.CmsCategory)1 UserMessage (com.bc.pmpheep.back.po.UserMessage)1 InfoWorking (com.bc.pmpheep.erp.service.InfoWorking)1 Message (com.bc.pmpheep.general.po.Message)1