Skip to content

Commit

Permalink
feat: Cleanup Portal API from Deprecated items - MEED-7669 - Meeds-io…
Browse files Browse the repository at this point in the history
  • Loading branch information
boubaker committed Oct 31, 2024
1 parent 065304f commit cf8fd1e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<component-plugin>
<name>DefaultRequestHandler</name>
<set-method>register</set-method>
<type>org.exoplatform.portal.application.DefaultRequestHandler</type>
<type>org.exoplatform.web.handler.DefaultRequestHandler</type>
</component-plugin>
<component-plugin>
<name>StaticResourceRequestHandler</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public static SiteKey getCurrentSite() {
return pContext.getSiteKey();
} else {
UserPortalConfigService portalConfig = getService(UserPortalConfigService.class);
return portalConfig == null ? null : SiteKey.portal(portalConfig.getDefaultPortal());
return portalConfig == null ? null : SiteKey.portal(portalConfig.getMetaPortal());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void afterTest() {
@Test
public void testShouldReturnDefaultPortalSite() {
UserPortalConfigService userPortalConfigService = mock(UserPortalConfigService.class);
when(userPortalConfigService.getDefaultPortal()).thenReturn("intranet");
when(userPortalConfigService.getMetaPortal()).thenReturn("intranet");

COMMONS_UTILS.when(() -> CommonsUtils.getService(UserPortalConfigService.class)).thenReturn(userPortalConfigService);
COMMONS_UTILS.when(() -> CommonsUtils.getCurrentSite()).thenCallRealMethod();
Expand All @@ -75,7 +75,7 @@ public void testShouldReturnDefaultPortalSite() {
@Test
public void testShouldReturnCurrentSite() {
UserPortalConfigService userPortalConfig = mock(UserPortalConfigService.class);
when(userPortalConfig.getDefaultPortal()).thenReturn("intranet");
when(userPortalConfig.getMetaPortal()).thenReturn("intranet");

PortalRequestContext requestContext = mock(PortalRequestContext.class);

Expand All @@ -102,7 +102,7 @@ public void testShouldReturnCurrentSite() {

public void testShouldReturnDefaultPortalOwner() {
UserPortalConfigService userPortalConfig = mock(UserPortalConfigService.class);
when(userPortalConfig.getDefaultPortal()).thenReturn("intranet");
when(userPortalConfig.getMetaPortal()).thenReturn("intranet");

COMMONS_UTILS.when(() -> CommonsUtils.getService(UserPortalConfigService.class)).thenReturn(userPortalConfig);
COMMONS_UTILS.when(() -> CommonsUtils.getCurrentSite()).thenCallRealMethod();
Expand All @@ -113,7 +113,7 @@ public void testShouldReturnDefaultPortalOwner() {

public void testShouldReturnCurrentPortalOwner() {
UserPortalConfigService userPortalConfig = mock(UserPortalConfigService.class);
when(userPortalConfig.getDefaultPortal()).thenReturn("intranet");
when(userPortalConfig.getMetaPortal()).thenReturn("intranet");

PortalRequestContext requestContext = mock(PortalRequestContext.class);

Expand Down

0 comments on commit cf8fd1e

Please sign in to comment.