From 4fc8d665dffede224525cd20922fc1f5033995c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Pulido?= Date: Tue, 26 Nov 2024 12:36:24 +0100 Subject: [PATCH] LPD-41552 Use PortletIdCodec to compute portlet ID and instance ID --- .../test/WidgetPageWidgetInstanceResourceTest.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/apps/headless/headless-admin-site/headless-admin-site-test/src/testIntegration/java/com/liferay/headless/admin/site/resource/v1_0/test/WidgetPageWidgetInstanceResourceTest.java b/modules/apps/headless/headless-admin-site/headless-admin-site-test/src/testIntegration/java/com/liferay/headless/admin/site/resource/v1_0/test/WidgetPageWidgetInstanceResourceTest.java index f985f66ba756e0..00623c3d05fb01 100644 --- a/modules/apps/headless/headless-admin-site/headless-admin-site-test/src/testIntegration/java/com/liferay/headless/admin/site/resource/v1_0/test/WidgetPageWidgetInstanceResourceTest.java +++ b/modules/apps/headless/headless-admin-site/headless-admin-site-test/src/testIntegration/java/com/liferay/headless/admin/site/resource/v1_0/test/WidgetPageWidgetInstanceResourceTest.java @@ -205,17 +205,17 @@ protected WidgetPageWidgetInstance randomWidgetPageWidgetInstance() WidgetPageWidgetInstance widgetPageWidgetInstance = new WidgetPageWidgetInstance(); - String widgetName = AssetPublisherPortletKeys.ASSET_PUBLISHER; - String widgetInstanceId = RandomTestUtil.randomString(); + String portletName = AssetPublisherPortletKeys.ASSET_PUBLISHER; - widgetPageWidgetInstance.setExternalReferenceCode( - widgetName + "_INSTANCE_" + widgetInstanceId); + String portletId = PortletIdCodec.encode(portletName); + + widgetPageWidgetInstance.setExternalReferenceCode(portletId); widgetPageWidgetInstance.setParentSectionId("column-1"); widgetPageWidgetInstance.setPosition(_position++); - widgetPageWidgetInstance.setWidgetName(widgetName); - - widgetPageWidgetInstance.setWidgetInstanceId(widgetInstanceId); + widgetPageWidgetInstance.setWidgetInstanceId( + PortletIdCodec.decodeInstanceId(portletId)); + widgetPageWidgetInstance.setWidgetName(portletName); return widgetPageWidgetInstance; }