Search in sources :

Example 6 with IdentityUrlParams

use of com.enonic.xp.portal.url.IdentityUrlParams in project xp by enonic.

the class PortalUrlServiceImpl_identityUrlTest method createUrl_absolute.

@Test
public void createUrl_absolute() {
    final IdentityUrlParams params = new IdentityUrlParams().portalRequest(this.portalRequest).type(UrlTypeConstants.ABSOLUTE).idProviderKey(IdProviderKey.system()).idProviderFunction("login");
    when(req.getServerName()).thenReturn("localhost");
    when(req.getScheme()).thenReturn("http");
    when(req.getServerPort()).thenReturn(80);
    final String url = this.service.identityUrl(params);
    assertEquals("http://localhost/site/default/draft/_/idprovider/system/login", url);
}
Also used : IdentityUrlParams(com.enonic.xp.portal.url.IdentityUrlParams) Test(org.junit.jupiter.api.Test)

Aggregations

IdentityUrlParams (com.enonic.xp.portal.url.IdentityUrlParams)6 Test (org.junit.jupiter.api.Test)6 VirtualHost (com.enonic.xp.web.vhost.VirtualHost)1