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);
}
Aggregations