From 21882d8a2ef566a50b4d579f9eb8ceb1ebfa1a6f Mon Sep 17 00:00:00 2001 From: Nilton Vieira Date: Tue, 3 Dec 2024 14:46:19 -0300 Subject: [PATCH] LPD-43431 Update test to assert name --- .../site-initializer/site-navigation-menus.json | 1 + .../site-initializer/site-navigation-menus.json | 3 ++- .../internal/test/BundleSiteInitializerTest.java | 16 ++++++++++++---- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/modules/apps/site-initializer/site-initializer-extender/site-initializer-extender-test-bundle-1/src/main/resources/site-initializer/site-navigation-menus.json b/modules/apps/site-initializer/site-initializer-extender/site-initializer-extender-test-bundle-1/src/main/resources/site-initializer/site-navigation-menus.json index 1f4d90943034ef..443c31ad018487 100644 --- a/modules/apps/site-initializer/site-initializer-extender/site-initializer-extender-test-bundle-1/src/main/resources/site-initializer/site-navigation-menus.json +++ b/modules/apps/site-initializer/site-initializer-extender/site-initializer-extender-test-bundle-1/src/main/resources/site-initializer/site-navigation-menus.json @@ -1,5 +1,6 @@ [ { + "externalReferenceCode": "SITENAVIGATIONMENU1", "menuItems": [ { "externalReferenceCode": "TESTSITENAVIGATIONMENUITEM1", diff --git a/modules/apps/site-initializer/site-initializer-extender/site-initializer-extender-test-bundle-2/src/main/resources/site-initializer/site-navigation-menus.json b/modules/apps/site-initializer/site-initializer-extender/site-initializer-extender-test-bundle-2/src/main/resources/site-initializer/site-navigation-menus.json index 453907fefc8d45..3ef51e51a0c10b 100644 --- a/modules/apps/site-initializer/site-initializer-extender/site-initializer-extender-test-bundle-2/src/main/resources/site-initializer/site-navigation-menus.json +++ b/modules/apps/site-initializer/site-initializer-extender/site-initializer-extender-test-bundle-2/src/main/resources/site-initializer/site-navigation-menus.json @@ -1,5 +1,6 @@ [ { + "externalReferenceCode": "SITENAVIGATIONMENU1", "menuItems": [ { "externalReferenceCode": "TESTSITENAVIGATIONMENUITEM1", @@ -65,6 +66,6 @@ "type": "layout" } ], - "name": "Test Site Navigation Menu" + "name": "Test Site Navigation Menu Update" } ] \ No newline at end of file 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 965662c0710ef3..8276fbdfb1bd72 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 @@ -3659,11 +3659,15 @@ private void _assertSiteConfiguration() { private void _assertSiteNavigationMenu1() { SiteNavigationMenu siteNavigationMenu = - _siteNavigationMenuLocalService.fetchSiteNavigationMenuByName( - _group.getGroupId(), "Test Site Navigation Menu"); + _siteNavigationMenuLocalService. + fetchSiteNavigationMenuByExternalReferenceCode( + "SITENAVIGATIONMENU1", _group.getGroupId()); Assert.assertNotNull(siteNavigationMenu); + Assert.assertEquals( + "Test Site Navigation Menu", siteNavigationMenu.getName()); + List siteNavigationMenuItems = _siteNavigationMenuItemLocalService.getSiteNavigationMenuItems( siteNavigationMenu.getSiteNavigationMenuId(), 0); @@ -3736,11 +3740,15 @@ private void _assertSiteNavigationMenu1() { private void _assertSiteNavigationMenu2() { SiteNavigationMenu siteNavigationMenu = - _siteNavigationMenuLocalService.fetchSiteNavigationMenuByName( - _group.getGroupId(), "Test Site Navigation Menu"); + _siteNavigationMenuLocalService. + fetchSiteNavigationMenuByExternalReferenceCode( + "SITENAVIGATIONMENU1", _group.getGroupId()); Assert.assertNotNull(siteNavigationMenu); + Assert.assertEquals( + "Test Site Navigation Menu Update", siteNavigationMenu.getName()); + List siteNavigationMenuItems = _siteNavigationMenuItemLocalService.getSiteNavigationMenuItems( siteNavigationMenu.getSiteNavigationMenuId(), 0);