From 7873ad39190664a7594a34fce1c604c851e17daf Mon Sep 17 00:00:00 2001 From: Thiago Buarque Date: Mon, 30 Sep 2024 14:42:15 -0300 Subject: [PATCH] LPD-35068 update usages and use RandomTestUtil for the themeId value --- .../LayoutStagedModelDataHandlerTest.java | 5 ++--- .../EditLayoutDesignMVCActionCommandTest.java | 3 ++- ...PageTemplateEntryMVCActionCommandTest.java | 5 ++--- ...youtPageTemplateEntryLocalServiceTest.java | 3 ++- .../StylebookEntryStagedModelRepository.java | 4 ++-- .../impl/StyleBookEntryLocalServiceImpl.java | 4 ++-- .../impl/StyleBookEntryServiceImpl.java | 6 +++--- ...BookEntryTableReferenceDefinitionTest.java | 4 ++-- ...ryVersionTableReferenceDefinitionTest.java | 4 ++-- .../test/StyleBookEntryLocalServiceTest.java | 8 ++++---- .../test/StyleBookEntryServiceTest.java | 20 +++++++++---------- ...eteStyleBookEntryMVCActionCommandTest.java | 13 +++++++----- ...eBookEntryPreviewMVCActionCommandTest.java | 3 ++- ...tyleBookEntriesMVCResourceCommandTest.java | 19 +++++++++--------- .../test/StyleBookEntryServiceTest.java | 5 ++--- ...eBookEntryDefaultMVCActionCommandTest.java | 12 +++++++---- ...tyleBookEntryNameMVCActionCommandTest.java | 16 +++++++++------ ...eBookEntryPreviewMVCActionCommandTest.java | 6 ++++-- .../AddStyleBookEntryMVCActionCommand.java | 2 +- .../StyleBookEntryZipProcessorImpl.java | 4 ++-- 20 files changed, 79 insertions(+), 67 deletions(-) diff --git a/modules/apps/layout/layout-admin-web-test/src/testIntegration/java/com/liferay/layout/admin/web/internal/exportimport/data/handler/test/LayoutStagedModelDataHandlerTest.java b/modules/apps/layout/layout-admin-web-test/src/testIntegration/java/com/liferay/layout/admin/web/internal/exportimport/data/handler/test/LayoutStagedModelDataHandlerTest.java index 09c6b51b9c2673..cca040dd2fbe5e 100644 --- a/modules/apps/layout/layout-admin-web-test/src/testIntegration/java/com/liferay/layout/admin/web/internal/exportimport/data/handler/test/LayoutStagedModelDataHandlerTest.java +++ b/modules/apps/layout/layout-admin-web-test/src/testIntegration/java/com/liferay/layout/admin/web/internal/exportimport/data/handler/test/LayoutStagedModelDataHandlerTest.java @@ -442,10 +442,9 @@ public void testStyleBookEntry() throws Exception { _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), stagingGroup.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, + StringPool.BLANK, RandomTestUtil.randomString(), ServiceContextTestUtil.getServiceContext( - stagingGroup.getGroupId()), - StringPool.BLANK); + stagingGroup.getGroupId())); Layout layout = LayoutTestUtil.addTypeContentLayout(stagingGroup); diff --git a/modules/apps/layout/layout-admin-web-test/src/testIntegration/java/com/liferay/layout/admin/web/internal/portlet/action/test/EditLayoutDesignMVCActionCommandTest.java b/modules/apps/layout/layout-admin-web-test/src/testIntegration/java/com/liferay/layout/admin/web/internal/portlet/action/test/EditLayoutDesignMVCActionCommandTest.java index a00a1ba0210251..03d69eec491be6 100644 --- a/modules/apps/layout/layout-admin-web-test/src/testIntegration/java/com/liferay/layout/admin/web/internal/portlet/action/test/EditLayoutDesignMVCActionCommandTest.java +++ b/modules/apps/layout/layout-admin-web-test/src/testIntegration/java/com/liferay/layout/admin/web/internal/portlet/action/test/EditLayoutDesignMVCActionCommandTest.java @@ -89,7 +89,8 @@ public void testEditLayoutDesignDoesntChangeWithNotEditedValues() _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, serviceContext, StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + serviceContext); FileEntry fileEntry = _dlAppLocalService.addFileEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), diff --git a/modules/apps/layout/layout-content-page-editor-web-test/src/testIntegration/java/com/liferay/layout/content/page/editor/web/internal/portlet/action/test/CreateLayoutPageTemplateEntryMVCActionCommandTest.java b/modules/apps/layout/layout-content-page-editor-web-test/src/testIntegration/java/com/liferay/layout/content/page/editor/web/internal/portlet/action/test/CreateLayoutPageTemplateEntryMVCActionCommandTest.java index e25fef0015740c..70494d9ddcaf1f 100644 --- a/modules/apps/layout/layout-content-page-editor-web-test/src/testIntegration/java/com/liferay/layout/content/page/editor/web/internal/portlet/action/test/CreateLayoutPageTemplateEntryMVCActionCommandTest.java +++ b/modules/apps/layout/layout-content-page-editor-web-test/src/testIntegration/java/com/liferay/layout/content/page/editor/web/internal/portlet/action/test/CreateLayoutPageTemplateEntryMVCActionCommandTest.java @@ -154,9 +154,8 @@ public void testCreateLayoutPageTemplateEntry() throws Exception { _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, - ServiceContextTestUtil.getServiceContext(_group.getGroupId()), - StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + ServiceContextTestUtil.getServiceContext(_group.getGroupId())); draftLayout = _layoutLocalService.updateStyleBookEntryId( draftLayout.getGroupId(), draftLayout.isPrivateLayout(), diff --git a/modules/apps/layout/layout-page-template-test/src/testIntegration/java/com/liferay/layout/page/template/service/test/LayoutPageTemplateEntryLocalServiceTest.java b/modules/apps/layout/layout-page-template-test/src/testIntegration/java/com/liferay/layout/page/template/service/test/LayoutPageTemplateEntryLocalServiceTest.java index f77a702fc3b06c..a2bf71c94c6d76 100644 --- a/modules/apps/layout/layout-page-template-test/src/testIntegration/java/com/liferay/layout/page/template/service/test/LayoutPageTemplateEntryLocalServiceTest.java +++ b/modules/apps/layout/layout-page-template-test/src/testIntegration/java/com/liferay/layout/page/template/service/test/LayoutPageTemplateEntryLocalServiceTest.java @@ -150,7 +150,8 @@ public void testUpdateLayoutPageTemplateEntryName() throws Exception { _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, _serviceContext, StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + _serviceContext); Layout layout = _layoutLocalService.fetchLayout( layoutPageTemplateEntry.getPlid()); diff --git a/modules/apps/style-book/style-book-service/src/main/java/com/liferay/style/book/internal/exportimport/staged/model/repository/StylebookEntryStagedModelRepository.java b/modules/apps/style-book/style-book-service/src/main/java/com/liferay/style/book/internal/exportimport/staged/model/repository/StylebookEntryStagedModelRepository.java index f37a1a499c4b45..b76ec6c49f27ab 100644 --- a/modules/apps/style-book/style-book-service/src/main/java/com/liferay/style/book/internal/exportimport/staged/model/repository/StylebookEntryStagedModelRepository.java +++ b/modules/apps/style-book/style-book-service/src/main/java/com/liferay/style/book/internal/exportimport/staged/model/repository/StylebookEntryStagedModelRepository.java @@ -50,8 +50,8 @@ public StyleBookEntry addStagedModel( styleBookEntry.getGroupId(), styleBookEntry.isDefaultStyleBookEntry(), styleBookEntry.getFrontendTokensValues(), styleBookEntry.getName(), - styleBookEntry.getStyleBookEntryKey(), serviceContext, - styleBookEntry.getThemeId()); + styleBookEntry.getStyleBookEntryKey(), styleBookEntry.getThemeId(), + serviceContext); } @Override diff --git a/modules/apps/style-book/style-book-service/src/main/java/com/liferay/style/book/service/impl/StyleBookEntryLocalServiceImpl.java b/modules/apps/style-book/style-book-service/src/main/java/com/liferay/style/book/service/impl/StyleBookEntryLocalServiceImpl.java index 80c94b4986eb1e..01c1bdde608f9c 100644 --- a/modules/apps/style-book/style-book-service/src/main/java/com/liferay/style/book/service/impl/StyleBookEntryLocalServiceImpl.java +++ b/modules/apps/style-book/style-book-service/src/main/java/com/liferay/style/book/service/impl/StyleBookEntryLocalServiceImpl.java @@ -114,8 +114,8 @@ public StyleBookEntry copyStyleBookEntry( StyleBookEntry targetStyleBookEntry = addStyleBookEntry( null, userId, groupId, false, sourceStyleBookEntry.getFrontendTokensValues(), name, - StringPool.BLANK, serviceContext, - sourceStyleBookEntry.getThemeId()); + StringPool.BLANK, sourceStyleBookEntry.getThemeId(), + serviceContext); long previewFileEntryId = _copyStyleBookEntryPreviewFileEntry( userId, groupId, sourceStyleBookEntry, targetStyleBookEntry); diff --git a/modules/apps/style-book/style-book-service/src/main/java/com/liferay/style/book/service/impl/StyleBookEntryServiceImpl.java b/modules/apps/style-book/style-book-service/src/main/java/com/liferay/style/book/service/impl/StyleBookEntryServiceImpl.java index 195653893ec622..f4c78179bc7bf8 100644 --- a/modules/apps/style-book/style-book-service/src/main/java/com/liferay/style/book/service/impl/StyleBookEntryServiceImpl.java +++ b/modules/apps/style-book/style-book-service/src/main/java/com/liferay/style/book/service/impl/StyleBookEntryServiceImpl.java @@ -40,7 +40,7 @@ public StyleBookEntry addStyleBookEntry( return addStyleBookEntry( externalReferenceCode, groupId, StringPool.BLANK, name, - styleBookEntryKey, serviceContext, themeId); + styleBookEntryKey, themeId, serviceContext); } @Override @@ -56,8 +56,8 @@ public StyleBookEntry addStyleBookEntry( return styleBookEntryLocalService.addStyleBookEntry( externalReferenceCode, getUserId(), groupId, false, - frontendTokensValues, name, styleBookEntryKey, serviceContext, - themeId); + frontendTokensValues, name, styleBookEntryKey, themeId, + serviceContext); } @Override diff --git a/modules/apps/style-book/style-book-test/src/testIntegration/java/com/liferay/style/book/change/tracking/test/StyleBookEntryTableReferenceDefinitionTest.java b/modules/apps/style-book/style-book-test/src/testIntegration/java/com/liferay/style/book/change/tracking/test/StyleBookEntryTableReferenceDefinitionTest.java index fa3a9628db361c..6b8a3b4c88cb07 100644 --- a/modules/apps/style-book/style-book-test/src/testIntegration/java/com/liferay/style/book/change/tracking/test/StyleBookEntryTableReferenceDefinitionTest.java +++ b/modules/apps/style-book/style-book-test/src/testIntegration/java/com/liferay/style/book/change/tracking/test/StyleBookEntryTableReferenceDefinitionTest.java @@ -41,8 +41,8 @@ protected CTModel addCTModel() throws Exception { return _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), TestPropsValues.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, ServiceContextTestUtil.getServiceContext(), - StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + ServiceContextTestUtil.getServiceContext()); } @Inject diff --git a/modules/apps/style-book/style-book-test/src/testIntegration/java/com/liferay/style/book/change/tracking/test/StyleBookEntryVersionTableReferenceDefinitionTest.java b/modules/apps/style-book/style-book-test/src/testIntegration/java/com/liferay/style/book/change/tracking/test/StyleBookEntryVersionTableReferenceDefinitionTest.java index e7889922993ca7..daab5221f1e374 100644 --- a/modules/apps/style-book/style-book-test/src/testIntegration/java/com/liferay/style/book/change/tracking/test/StyleBookEntryVersionTableReferenceDefinitionTest.java +++ b/modules/apps/style-book/style-book-test/src/testIntegration/java/com/liferay/style/book/change/tracking/test/StyleBookEntryVersionTableReferenceDefinitionTest.java @@ -46,8 +46,8 @@ public void setUp() throws Exception { _styleBookEntry = _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), TestPropsValues.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - RandomTestUtil.randomString(), - ServiceContextTestUtil.getServiceContext(), StringPool.BLANK); + RandomTestUtil.randomString(), RandomTestUtil.randomString(), + ServiceContextTestUtil.getServiceContext()); } @Override diff --git a/modules/apps/style-book/style-book-test/src/testIntegration/java/com/liferay/style/book/service/test/StyleBookEntryLocalServiceTest.java b/modules/apps/style-book/style-book-test/src/testIntegration/java/com/liferay/style/book/service/test/StyleBookEntryLocalServiceTest.java index d96587d3f8d55a..a7dd4510c5ad74 100644 --- a/modules/apps/style-book/style-book-test/src/testIntegration/java/com/liferay/style/book/service/test/StyleBookEntryLocalServiceTest.java +++ b/modules/apps/style-book/style-book-test/src/testIntegration/java/com/liferay/style/book/service/test/StyleBookEntryLocalServiceTest.java @@ -56,7 +56,7 @@ public void testAddStyleBookEntry() throws Exception { _styleBookEntryLocalService.addStyleBookEntry( RandomTestUtil.randomString(), TestPropsValues.getUserId(), _group.getGroupId(), false, null, RandomTestUtil.randomString(), - null, _serviceContext, null); + null, RandomTestUtil.randomString(), _serviceContext); Assert.assertTrue( Validator.isNotNull(styleBookEntry.getExternalReferenceCode())); @@ -73,11 +73,11 @@ public void testAddStyleBookEntryWithExistingExternalReferenceCode() _styleBookEntryLocalService.addStyleBookEntry( externalReferenceCode, TestPropsValues.getUserId(), _group.getGroupId(), false, null, RandomTestUtil.randomString(), - null, _serviceContext, null); + null, RandomTestUtil.randomString(), _serviceContext); _styleBookEntryLocalService.addStyleBookEntry( externalReferenceCode, TestPropsValues.getUserId(), _group.getGroupId(), false, null, RandomTestUtil.randomString(), - null, _serviceContext, null); + null, RandomTestUtil.randomString(), _serviceContext); } @Test @@ -88,7 +88,7 @@ public void testDeleteStyleBookEntryByExternalReferenceCode() _styleBookEntryLocalService.addStyleBookEntry( RandomTestUtil.randomString(), TestPropsValues.getUserId(), _group.getGroupId(), false, null, RandomTestUtil.randomString(), - null, _serviceContext, null); + null, RandomTestUtil.randomString(), _serviceContext); _styleBookEntryLocalService.deleteStyleBookEntry( styleBookEntry.getExternalReferenceCode(), diff --git a/modules/apps/style-book/style-book-test/src/testIntegration/java/com/liferay/style/book/service/test/StyleBookEntryServiceTest.java b/modules/apps/style-book/style-book-test/src/testIntegration/java/com/liferay/style/book/service/test/StyleBookEntryServiceTest.java index ca95b10f4fa63f..d35a090b2e5276 100644 --- a/modules/apps/style-book/style-book-test/src/testIntegration/java/com/liferay/style/book/service/test/StyleBookEntryServiceTest.java +++ b/modules/apps/style-book/style-book-test/src/testIntegration/java/com/liferay/style/book/service/test/StyleBookEntryServiceTest.java @@ -63,8 +63,8 @@ public void testAddStyleBookEntryWithoutAddPermission() throws Exception { _styleBookEntryService.addStyleBookEntry( RandomTestUtil.randomString(), _group.getGroupId(), - RandomTestUtil.randomString(), null, _serviceContext, - RandomTestUtil.randomString()); + RandomTestUtil.randomString(), null, + RandomTestUtil.randomString(), _serviceContext); Assert.fail(); } @@ -82,8 +82,8 @@ public void testDeleteStyleBookEntryByExternalReferenceCode() StyleBookEntry styleBookEntry = _styleBookEntryService.addStyleBookEntry( RandomTestUtil.randomString(), _group.getGroupId(), - RandomTestUtil.randomString(), null, _serviceContext, - RandomTestUtil.randomString()); + RandomTestUtil.randomString(), null, + RandomTestUtil.randomString(), _serviceContext); _styleBookEntryService.deleteStyleBookEntry( styleBookEntry.getExternalReferenceCode(), @@ -101,8 +101,8 @@ public void testDeleteStyleBookEntryByExternalReferenceCodeWithoutDeletePermissi StyleBookEntry styleBookEntry = _styleBookEntryService.addStyleBookEntry( RandomTestUtil.randomString(), _group.getGroupId(), - RandomTestUtil.randomString(), null, _serviceContext, - RandomTestUtil.randomString()); + RandomTestUtil.randomString(), null, + RandomTestUtil.randomString(), _serviceContext); try { UserTestUtil.setUser( @@ -128,8 +128,8 @@ public void testGetStyleBookEntryByExternalReferenceCode() StyleBookEntry styleBookEntry = _styleBookEntryService.addStyleBookEntry( RandomTestUtil.randomString(), _group.getGroupId(), - RandomTestUtil.randomString(), null, _serviceContext, - RandomTestUtil.randomString()); + RandomTestUtil.randomString(), null, + RandomTestUtil.randomString(), _serviceContext); StyleBookEntry curStyleBookEntry = _styleBookEntryService.getStyleBookEntryByExternalReferenceCode( @@ -148,8 +148,8 @@ public void testGetStyleBookEntryByExternalReferenceCodeWithoutViewPermission() StyleBookEntry styleBookEntry = _styleBookEntryService.addStyleBookEntry( RandomTestUtil.randomString(), _group.getGroupId(), - RandomTestUtil.randomString(), null, _serviceContext, - RandomTestUtil.randomString()); + RandomTestUtil.randomString(), null, + RandomTestUtil.randomString(), _serviceContext); RoleTestUtil.removeResourcePermission( RoleConstants.GUEST, StyleBookEntry.class.getName(), diff --git a/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/DeleteStyleBookEntryMVCActionCommandTest.java b/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/DeleteStyleBookEntryMVCActionCommandTest.java index 91cc545fe84ecf..1b036da69b1730 100644 --- a/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/DeleteStyleBookEntryMVCActionCommandTest.java +++ b/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/DeleteStyleBookEntryMVCActionCommandTest.java @@ -65,13 +65,15 @@ public void testDeleteStyleBookEntries() throws Exception { _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, _serviceContext, StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + _serviceContext); StyleBookEntry styleBookEntry2 = _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, _serviceContext, StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + _serviceContext); MockLiferayPortletActionRequest mockLiferayPortletActionRequest = new MockLiferayPortletActionRequest(); @@ -99,8 +101,8 @@ public void testDeleteStyleBookEntry() throws Exception { StyleBookEntry styleBookEntry = _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, - StringPool.BLANK, name, StringPool.BLANK, _serviceContext, - StringPool.BLANK); + StringPool.BLANK, name, StringPool.BLANK, + RandomTestUtil.randomString(), _serviceContext); MockLiferayPortletActionRequest mockLiferayPortletActionRequest = new MockLiferayPortletActionRequest(); @@ -130,7 +132,8 @@ public void testDeleteStyleBookEntryWithPreviewFileEntry() _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, _serviceContext, StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + _serviceContext); FileEntry fileEntry = _addFileEntry(styleBookEntry); diff --git a/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/DeleteStyleBookEntryPreviewMVCActionCommandTest.java b/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/DeleteStyleBookEntryPreviewMVCActionCommandTest.java index 7df697c7dce3d7..2deeafa6755802 100644 --- a/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/DeleteStyleBookEntryPreviewMVCActionCommandTest.java +++ b/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/DeleteStyleBookEntryPreviewMVCActionCommandTest.java @@ -64,7 +64,8 @@ public void testDeleteStyleBookEntryPreviewFileEntry() throws Exception { _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, _serviceContext, StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + _serviceContext); FileEntry fileEntry = _addFileEntry(styleBookEntry); diff --git a/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/ExportImportStyleBookEntriesMVCResourceCommandTest.java b/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/ExportImportStyleBookEntriesMVCResourceCommandTest.java index 00d13048027a8d..e5950e6bb3cad8 100644 --- a/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/ExportImportStyleBookEntriesMVCResourceCommandTest.java +++ b/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/ExportImportStyleBookEntriesMVCResourceCommandTest.java @@ -7,7 +7,6 @@ import com.liferay.arquillian.extension.junit.bridge.junit.Arquillian; import com.liferay.petra.string.CharPool; -import com.liferay.petra.string.StringPool; import com.liferay.portal.kernel.json.JSONFactoryUtil; import com.liferay.portal.kernel.json.JSONObject; import com.liferay.portal.kernel.model.Group; @@ -78,13 +77,13 @@ public void testExportImportMultipleStyleBookEntries() throws Exception { null, TestPropsValues.getUserId(), _sourceGroup.getGroupId(), false, _read("frontend-tokens-values.json"), RandomTestUtil.randomString(), "STYLE_BOOK_ENTRY_KEY_1", - serviceContext, StringPool.BLANK); + RandomTestUtil.randomString(), serviceContext); StyleBookEntry styleBookEntry2 = _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _sourceGroup.getGroupId(), false, _read("frontend-tokens-values.json"), RandomTestUtil.randomString(), "STYLE_BOOK_ENTRY_KEY_2", - serviceContext, StringPool.BLANK); + RandomTestUtil.randomString(), serviceContext); File file = ReflectionTestUtil.invoke( _exportStyleBookEntriesMVCResourceCommand, @@ -122,8 +121,8 @@ public void testExportImportSingleStyleBookEntry() throws Exception { _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _sourceGroup.getGroupId(), false, _read("frontend-tokens-values.json"), - "Style Book Entry Name", "STYLE_BOOK_ENTRY_KEY", serviceContext, - StringPool.BLANK); + "Style Book Entry Name", "STYLE_BOOK_ENTRY_KEY", + RandomTestUtil.randomString(), serviceContext); File file = ReflectionTestUtil.invoke( _exportStyleBookEntriesMVCResourceCommand, @@ -174,8 +173,8 @@ public void testExportImportSingleStyleBookEntryAndNotOverwrite() _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _sourceGroup.getGroupId(), false, _read("frontend-tokens-values.json"), - "Style Book Entry Name", "STYLE_BOOK_ENTRY_KEY", serviceContext, - StringPool.BLANK); + "Style Book Entry Name", "STYLE_BOOK_ENTRY_KEY", + RandomTestUtil.randomString(), serviceContext); File file = ReflectionTestUtil.invoke( _exportStyleBookEntriesMVCResourceCommand, @@ -218,8 +217,8 @@ public void testExportImportSingleStyleBookEntryAndOverwrite() _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _sourceGroup.getGroupId(), false, _read("frontend-tokens-values.json"), - "Style Book Entry Name", "STYLE_BOOK_ENTRY_KEY", serviceContext, - StringPool.BLANK); + "Style Book Entry Name", "STYLE_BOOK_ENTRY_KEY", + RandomTestUtil.randomString(), serviceContext); File file = ReflectionTestUtil.invoke( _exportStyleBookEntriesMVCResourceCommand, @@ -284,7 +283,7 @@ public void testExportStyleBookEntries() throws Exception { null, TestPropsValues.getUserId(), _sourceGroup.getGroupId(), false, _read("frontend-tokens-values.json"), RandomTestUtil.randomString(), "STYLE_BOOK_ENTRY_KEY", - serviceContext, StringPool.BLANK); + RandomTestUtil.randomString(), serviceContext); FileEntry fileEntry = _addFileEntry(styleBookEntry); diff --git a/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/StyleBookEntryServiceTest.java b/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/StyleBookEntryServiceTest.java index 196c09d02be552..3b25512ecfde45 100644 --- a/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/StyleBookEntryServiceTest.java +++ b/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/StyleBookEntryServiceTest.java @@ -52,9 +52,8 @@ public void testCopyStyleBookEntry() throws Exception { StyleBookEntry sourceStyleBookEntry = _styleBookEntryService.addStyleBookEntry( null, _group.getGroupId(), RandomTestUtil.randomString(), - "STYLE_BOOK_ENTRY_KEY", - ServiceContextTestUtil.getServiceContext(_group.getGroupId()), - RandomTestUtil.randomString()); + "STYLE_BOOK_ENTRY_KEY", RandomTestUtil.randomString(), + ServiceContextTestUtil.getServiceContext(_group.getGroupId())); StyleBookEntry targetStyleBookEntry = _styleBookEntryService.copyStyleBookEntry( diff --git a/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/UpdateStyleBookEntryDefaultMVCActionCommandTest.java b/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/UpdateStyleBookEntryDefaultMVCActionCommandTest.java index cfbad8b6888acb..ffddbb24d5ce49 100644 --- a/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/UpdateStyleBookEntryDefaultMVCActionCommandTest.java +++ b/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/UpdateStyleBookEntryDefaultMVCActionCommandTest.java @@ -77,7 +77,8 @@ public void testMarkAsDefaultStyleBookEntry() throws Exception { _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, _serviceContext, StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + _serviceContext); MockLiferayPortletActionRequest mockLiferayPortletActionRequest = new MockLiferayPortletActionRequest(); @@ -107,7 +108,8 @@ public void testReplaceDefaultStyleBookEntry() throws Exception { _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, _serviceContext, StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + _serviceContext); MockLiferayPortletActionRequest mockLiferayPortletActionRequest = new MockLiferayPortletActionRequest(); @@ -134,7 +136,8 @@ public void testReplaceDefaultStyleBookEntry() throws Exception { _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, _serviceContext, StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + _serviceContext); mockLiferayPortletActionRequest = new MockLiferayPortletActionRequest(); @@ -167,7 +170,8 @@ public void testUnmarkAsDefaultStyleBookEntry() throws Exception { _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, _serviceContext, StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + _serviceContext); MockLiferayPortletActionRequest mockLiferayPortletActionRequest = new MockLiferayPortletActionRequest(); diff --git a/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/UpdateStyleBookEntryNameMVCActionCommandTest.java b/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/UpdateStyleBookEntryNameMVCActionCommandTest.java index 5d3987ba140777..559956dd6b0285 100644 --- a/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/UpdateStyleBookEntryNameMVCActionCommandTest.java +++ b/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/UpdateStyleBookEntryNameMVCActionCommandTest.java @@ -92,8 +92,8 @@ public void testUpdateStyleBookEntryName() throws PortalException { StyleBookEntry styleBookEntry = _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, - StringPool.BLANK, oldName, StringPool.BLANK, _serviceContext, - StringPool.BLANK); + StringPool.BLANK, oldName, StringPool.BLANK, + RandomTestUtil.randomString(), _serviceContext); MockLiferayPortletActionRequest mockLiferayPortletActionRequest = new MockLiferayPortletActionRequest(); @@ -135,7 +135,8 @@ public void testUpdateStyleBookEntryNameWithEmptyName() _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, _serviceContext, StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + _serviceContext); MockLiferayPortletActionRequest mockLiferayPortletActionRequest = new MockLiferayPortletActionRequest(); @@ -161,7 +162,8 @@ public void testUpdateStyleBookEntryNameWithInvalidCharPeriod() _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, _serviceContext, StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + _serviceContext); MockLiferayPortletActionRequest mockLiferayPortletActionRequest = new MockLiferayPortletActionRequest(); @@ -186,7 +188,8 @@ public void testUpdateStyleBookEntryNameWithInvalidCharSlash() _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, _serviceContext, StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + _serviceContext); MockLiferayPortletActionRequest mockLiferayPortletActionRequest = new MockLiferayPortletActionRequest(); @@ -211,7 +214,8 @@ public void testUpdateStyleBookEntryNameWithNameMaxLength() _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, _serviceContext, StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + _serviceContext); MockLiferayPortletActionRequest mockLiferayPortletActionRequest = new MockLiferayPortletActionRequest(); diff --git a/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/UpdateStyleBookEntryPreviewMVCActionCommandTest.java b/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/UpdateStyleBookEntryPreviewMVCActionCommandTest.java index edafade4bb2bdd..051d0a29773fb2 100644 --- a/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/UpdateStyleBookEntryPreviewMVCActionCommandTest.java +++ b/modules/apps/style-book/style-book-web-test/src/testIntegration/java/com/liferay/style/book/web/internal/portlet/action/test/UpdateStyleBookEntryPreviewMVCActionCommandTest.java @@ -98,7 +98,8 @@ public void testReplaceStyleBookEntryPreview() throws Exception { _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, _serviceContext, StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + _serviceContext); MockLiferayPortletActionRequest mockLiferayPortletActionRequest = new MockLiferayPortletActionRequest(); @@ -184,7 +185,8 @@ public void testUpdateStyleBookEntryPreview() throws Exception { _styleBookEntryLocalService.addStyleBookEntry( null, TestPropsValues.getUserId(), _group.getGroupId(), false, StringPool.BLANK, RandomTestUtil.randomString(), - StringPool.BLANK, _serviceContext, StringPool.BLANK); + StringPool.BLANK, RandomTestUtil.randomString(), + _serviceContext); FileEntry tempFileEntry = _addFileEntry( "thumbnail.png", styleBookEntry); diff --git a/modules/apps/style-book/style-book-web/src/main/java/com/liferay/style/book/web/internal/portlet/action/AddStyleBookEntryMVCActionCommand.java b/modules/apps/style-book/style-book-web/src/main/java/com/liferay/style/book/web/internal/portlet/action/AddStyleBookEntryMVCActionCommand.java index c76707457160de..2fa39f34e2c5e3 100644 --- a/modules/apps/style-book/style-book-web/src/main/java/com/liferay/style/book/web/internal/portlet/action/AddStyleBookEntryMVCActionCommand.java +++ b/modules/apps/style-book/style-book-web/src/main/java/com/liferay/style/book/web/internal/portlet/action/AddStyleBookEntryMVCActionCommand.java @@ -82,7 +82,7 @@ private StyleBookEntry _addStyleBookEntry(ActionRequest actionRequest) return _styleBookEntryService.addStyleBookEntry( null, serviceContext.getScopeGroupId(), name, StringPool.BLANK, - serviceContext, themeId); + themeId, serviceContext); } private String _getRedirectURL( diff --git a/modules/apps/style-book/style-book-web/src/main/java/com/liferay/style/book/web/internal/zip/processor/StyleBookEntryZipProcessorImpl.java b/modules/apps/style-book/style-book-web/src/main/java/com/liferay/style/book/web/internal/zip/processor/StyleBookEntryZipProcessorImpl.java index 2d0a0b2987a664..4310a8acac30c3 100644 --- a/modules/apps/style-book/style-book-web/src/main/java/com/liferay/style/book/web/internal/zip/processor/StyleBookEntryZipProcessorImpl.java +++ b/modules/apps/style-book/style-book-web/src/main/java/com/liferay/style/book/web/internal/zip/processor/StyleBookEntryZipProcessorImpl.java @@ -121,8 +121,8 @@ private StyleBookEntry _addStyleBookEntry( if (styleBookEntry == null) { styleBookEntry = _styleBookEntryEntryService.addStyleBookEntry( null, groupId, frontendTokensValues, name, - styleBookEntryKey, - ServiceContextThreadLocal.getServiceContext(), themeId); + styleBookEntryKey, themeId, + ServiceContextThreadLocal.getServiceContext()); } else { styleBookEntry =