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()));
}
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()));
}
Aggregations