@Test public void removeForumFromForumWidget() { DraftForum forum = new DraftForum(); forum.setName("name"); persistance.putItem(forum); Site site = new Site(); site.getSitePaymentSettings().setUserId(-1); site.setTitle("f"); site.getThemeId().setTemplateDirectory("f"); site.getThemeId().setThemeCss("f"); site.setSubDomain("f"); persistance.putSite(site); Page page = TestUtil.createPage(site); PageManager pageVersion = new PageManager(page); WidgetItem widgetForum = new WidgetItem(); widgetForum.setDraftItem(forum); persistance.putWidget(widgetForum); pageVersion.addWidget(widgetForum); persistance.removeDraftItem(forum); Assert.assertNull(persistance.getDraftItem(forum.getId())); Assert.assertNotNull(widgetForum.getDraftItem()); }
@Test public void removeForum() { DraftForum forum = new DraftForum(); forum.setName("name"); persistance.putItem(forum); persistance.removeDraftItem(forum); Assert.assertNull(persistance.getDraftItem(forum.getId())); }
@Test public void putForum() { DraftForum forum = new DraftForum(); forum.setName("name"); persistance.putItem(forum); DraftForum findForum = HibernateManager.get().find(DraftForum.class, forum.getId()); Assert.assertEquals(forum, findForum); }