From e15f84ee11abac54ee86da392eb0c8bcc6442401 Mon Sep 17 00:00:00 2001 From: Nilton Vieira Date: Tue, 4 Jun 2024 10:41:28 -0300 Subject: [PATCH] LPD-27322 add asserts to check dlFileEntries --- .../test/BundleSiteInitializerTest.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/modules/apps/site-initializer/site-initializer-extender/site-initializer-extender-test/src/testIntegration/java/com/liferay/site/initializer/extender/internal/test/BundleSiteInitializerTest.java b/modules/apps/site-initializer/site-initializer-extender/site-initializer-extender-test/src/testIntegration/java/com/liferay/site/initializer/extender/internal/test/BundleSiteInitializerTest.java index b51da6f9c3cd5e..68ea872d81f017 100644 --- a/modules/apps/site-initializer/site-initializer-extender/site-initializer-extender-test/src/testIntegration/java/com/liferay/site/initializer/extender/internal/test/BundleSiteInitializerTest.java +++ b/modules/apps/site-initializer/site-initializer-extender/site-initializer-extender-test/src/testIntegration/java/com/liferay/site/initializer/extender/internal/test/BundleSiteInitializerTest.java @@ -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; @@ -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() { @@ -4191,6 +4211,9 @@ private void _test2(SiteInitializer siteInitializer) throws Exception { @Inject private DLFileEntryLocalService _dlFileEntryLocalService; + @Inject + private DLFolderLocalService _dlFolderLocalService; + @Inject private FragmentEntryLinkLocalService _fragmentEntryLinkLocalService;