@Test public void testDeleteAttachmentsWhenDeletingWikiPage() throws Exception { int initialFileEntriesCount = DLFileEntryLocalServiceUtil.getFileEntriesCount(); addWikiPageAttachment(); Assert.assertEquals( initialFileEntriesCount + 1, DLFileEntryLocalServiceUtil.getFileEntriesCount()); WikiPageLocalServiceUtil.deletePage(_page.getNodeId(), _page.getTitle()); Assert.assertEquals(initialFileEntriesCount, DLFileEntryLocalServiceUtil.getFileEntriesCount()); }
@Test public void testFoldersCountWhenDeletingWikiPageWithoutAttachments() throws Exception { int initialFoldersCount = DLFolderLocalServiceUtil.getDLFoldersCount(); addWikiPage(); Assert.assertEquals(initialFoldersCount, DLFolderLocalServiceUtil.getDLFoldersCount()); WikiPageLocalServiceUtil.deletePage(_page.getNodeId(), _page.getTitle()); Assert.assertEquals(initialFoldersCount, DLFolderLocalServiceUtil.getDLFoldersCount()); }