From df6998d96dcf7af48fe15f08cd51de7f0ef88aae Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Wed, 11 May 2022 16:29:54 +0200 Subject: [PATCH] LPS-152969 auto SF --- ...abularySiteNavigationMenuItemTypeTest.java | 104 +++++++++--------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/modules/apps/site-navigation/site-navigation-menu-item-asset-vocabulary-test/src/testIntegration/java/com/liferay/site/navigation/menu/item/asset/vocabulary/test/AssetVocabularySiteNavigationMenuItemTypeTest.java b/modules/apps/site-navigation/site-navigation-menu-item-asset-vocabulary-test/src/testIntegration/java/com/liferay/site/navigation/menu/item/asset/vocabulary/test/AssetVocabularySiteNavigationMenuItemTypeTest.java index 4f4b62377c840e..8e7db39c60005e 100644 --- a/modules/apps/site-navigation/site-navigation-menu-item-asset-vocabulary-test/src/testIntegration/java/com/liferay/site/navigation/menu/item/asset/vocabulary/test/AssetVocabularySiteNavigationMenuItemTypeTest.java +++ b/modules/apps/site-navigation/site-navigation-menu-item-asset-vocabulary-test/src/testIntegration/java/com/liferay/site/navigation/menu/item/asset/vocabulary/test/AssetVocabularySiteNavigationMenuItemTypeTest.java @@ -628,6 +628,58 @@ public void testIsBrowsableAssetVocabularyType() throws Exception { siteNavigationMenuItemType.isBrowsable(siteNavigationMenuItem)); } + private AssetCategory _addAssetCategory(long parentAssetCategoryId) + throws Exception { + + return _assetCategoryLocalService.addCategory( + null, TestPropsValues.getUserId(), _group.getGroupId(), + parentAssetCategoryId, RandomTestUtil.randomLocaleStringMap(), + RandomTestUtil.randomLocaleStringMap(), + _assetVocabulary.getVocabularyId(), null, _serviceContext); + } + + private SiteNavigationMenuItem _addSiteNavigationMenuItem( + Locale defaultLocale, String localizedNames, + boolean showAssetVocabularyLevel) + throws Exception { + + SiteNavigationMenu siteNavigationMenu = + _siteNavigationMenuLocalService.addSiteNavigationMenu( + TestPropsValues.getUserId(), _group.getGroupId(), + RandomTestUtil.randomString(), + SiteNavigationConstants.TYPE_DEFAULT, true, _serviceContext); + + return _siteNavigationMenuItemLocalService.addSiteNavigationMenuItem( + TestPropsValues.getUserId(), _group.getGroupId(), + siteNavigationMenu.getSiteNavigationMenuId(), 0, + SiteNavigationMenuItemTypeConstants.ASSET_VOCABULARY, + UnicodePropertiesBuilder.create( + true + ).put( + Field.DEFAULT_LANGUAGE_ID, + LocaleUtil.toLanguageId(defaultLocale) + ).put( + "classPK", String.valueOf(_assetVocabulary.getVocabularyId()) + ).put( + "groupId", String.valueOf(_assetVocabulary.getGroupId()) + ).put( + "localizedNames", localizedNames + ).put( + "showAssetVocabularyLevel", + String.valueOf(showAssetVocabularyLevel) + ).put( + "title", _assetVocabulary.getTitle(defaultLocale) + ).put( + "type", "asset-vocabulary" + ).put( + "useCustomName", + String.valueOf(!Objects.equals("{}", localizedNames)) + ).put( + "uuid", _assetVocabulary.getUuid() + ).buildString(), + _serviceContext); + } + private void _assertAssetCategorySiteNavigationMenuItem( AssetCategory assetCategory, Locale locale, SiteNavigationMenuItem assetCategorySiteNavigationMenuItem) { @@ -696,58 +748,6 @@ private void _assertGetChildrenSiteNavigationMenuItems( } } - private AssetCategory _addAssetCategory(long parentAssetCategoryId) - throws Exception { - - return _assetCategoryLocalService.addCategory( - null, TestPropsValues.getUserId(), _group.getGroupId(), - parentAssetCategoryId, RandomTestUtil.randomLocaleStringMap(), - RandomTestUtil.randomLocaleStringMap(), - _assetVocabulary.getVocabularyId(), null, _serviceContext); - } - - private SiteNavigationMenuItem _addSiteNavigationMenuItem( - Locale defaultLocale, String localizedNames, - boolean showAssetVocabularyLevel) - throws Exception { - - SiteNavigationMenu siteNavigationMenu = - _siteNavigationMenuLocalService.addSiteNavigationMenu( - TestPropsValues.getUserId(), _group.getGroupId(), - RandomTestUtil.randomString(), - SiteNavigationConstants.TYPE_DEFAULT, true, _serviceContext); - - return _siteNavigationMenuItemLocalService.addSiteNavigationMenuItem( - TestPropsValues.getUserId(), _group.getGroupId(), - siteNavigationMenu.getSiteNavigationMenuId(), 0, - SiteNavigationMenuItemTypeConstants.ASSET_VOCABULARY, - UnicodePropertiesBuilder.create( - true - ).put( - Field.DEFAULT_LANGUAGE_ID, - LocaleUtil.toLanguageId(defaultLocale) - ).put( - "classPK", String.valueOf(_assetVocabulary.getVocabularyId()) - ).put( - "groupId", String.valueOf(_assetVocabulary.getGroupId()) - ).put( - "localizedNames", localizedNames - ).put( - "showAssetVocabularyLevel", - String.valueOf(showAssetVocabularyLevel) - ).put( - "title", _assetVocabulary.getTitle(defaultLocale) - ).put( - "type", "asset-vocabulary" - ).put( - "useCustomName", - String.valueOf(!Objects.equals("{}", localizedNames)) - ).put( - "uuid", _assetVocabulary.getUuid() - ).buildString(), - _serviceContext); - } - private SiteNavigationMenuItem _getAssetCategorySiteNavigationMenuItem( AssetCategory assetCategory, MockHttpServletRequest mockHttpServletRequest, Locale locale,