use of com.enonic.xp.portal.url.ImageUrlParams in project xp by enonic.
the class PortalUrlServiceImpl_imageUrlTest method createUrl_withId_notFound.
@Test
public void createUrl_withId_notFound() {
createContentNotFound();
final ImageUrlParams params = new ImageUrlParams().id("123456").portalRequest(this.portalRequest).scale("max(300)").validate();
final String url = this.service.imageUrl(params);
assertEquals("/site/default/draft/context/path/_/error/500?message=Image+with+%5B123456%5D+id+not+found", url);
}
use of com.enonic.xp.portal.url.ImageUrlParams in project xp by enonic.
the class PortalUrlServiceImpl_imageUrlTest method createUrl_withPath.
@Test
public void createUrl_withPath() {
createContent();
final ImageUrlParams params = new ImageUrlParams().path("/a/b/mycontent").portalRequest(this.portalRequest).scale("max(300)").validate();
final String url = this.service.imageUrl(params);
assertEquals("/site/default/draft/context/path/_/image/123456:8cf45815bba82c9711c673c9bb7304039a790026/max-300/mycontent", url);
}
Aggregations