Skip to content

Commit

Permalink
LPD-27322 add asserts to check dlFileEntries
Browse files Browse the repository at this point in the history
  • Loading branch information
nNilton committed Jun 4, 2024
1 parent 51a8ca3 commit e15f84e
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@
import com.liferay.depot.service.DepotAppCustomizationLocalService;
import com.liferay.depot.service.DepotEntryLocalService;
import com.liferay.document.library.kernel.model.DLFileEntry;
import com.liferay.document.library.kernel.model.DLFolder;
import com.liferay.document.library.kernel.model.DLFolderConstants;
import com.liferay.document.library.kernel.service.DLFileEntryLocalService;
import com.liferay.document.library.kernel.service.DLFolderLocalService;
import com.liferay.dynamic.data.mapping.model.DDMStructure;
import com.liferay.dynamic.data.mapping.model.DDMTemplate;
import com.liferay.dynamic.data.mapping.service.DDMStructureLocalService;
Expand Down Expand Up @@ -1465,6 +1467,24 @@ private void _assertDLFileEntry2() throws Exception {
Assert.assertTrue(string.contains("1. Revelation"));
Assert.assertTrue(string.contains("## Content Update"));
Assert.assertTrue(string.contains("1. Test Update"));

DLFolder dlFolder = _dlFolderLocalService.fetchFolder(
_group.getGroupId(), DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
"Old Testament");

Assert.assertNotNull(dlFolder);

dlFileEntry = _dlFileEntryLocalService.getFileEntry(
_group.getGroupId(), dlFolder.getFolderId(), "Genesis.txt");

Assert.assertNotNull(dlFileEntry);

string = new String(
StreamUtil.toByteArray(
_dlFileEntryLocalService.getFileAsStream(
dlFileEntry.getFileEntryId(), dlFileEntry.getVersion())));

Assert.assertTrue(string.isEmpty());
}

private void _assertExpandoColumns1() {
Expand Down Expand Up @@ -4191,6 +4211,9 @@ private void _test2(SiteInitializer siteInitializer) throws Exception {
@Inject
private DLFileEntryLocalService _dlFileEntryLocalService;

@Inject
private DLFolderLocalService _dlFolderLocalService;

@Inject
private FragmentEntryLinkLocalService _fragmentEntryLinkLocalService;

Expand Down

0 comments on commit e15f84e

Please sign in to comment.