use of com.enonic.xp.portal.url.ImageUrlParams in project xp by enonic.
the class PortalUrlServiceImpl_imageUrlTest method createUrl_withNonMediaContent.
@Test
public void createUrl_withNonMediaContent() {
this.portalRequest.setContent(createContent("non-media", false));
final ImageUrlParams params = new ImageUrlParams().format("png").portalRequest(this.portalRequest).scale("max(300)").validate();
assertEquals("/site/default/draft/a/b/mycontent/_/error/500?message=Image+with+%5B123456%5D+id+not+found", this.service.imageUrl(params));
}
use of com.enonic.xp.portal.url.ImageUrlParams in project xp by enonic.
the class PortalUrlServiceImpl_imageUrlTest method createUrl_withoutContentPath.
@Test
public void createUrl_withoutContentPath() {
this.portalRequest.setContent(createContent());
final ImageUrlParams params = new ImageUrlParams().portalRequest(this.portalRequest).contextPathType(ContextPathType.VHOST.getValue()).scale("max(300)").validate();
final String url = this.service.imageUrl(params);
assertEquals("/site/default/draft/_/image/123456:8cf45815bba82c9711c673c9bb7304039a790026/max-300/mycontent", url);
}
use of com.enonic.xp.portal.url.ImageUrlParams in project xp by enonic.
the class PortalUrlServiceImpl_imageUrlTest method createUrl_withFormat.
@Test
public void createUrl_withFormat() {
this.portalRequest.setContent(createContent());
final ImageUrlParams params = new ImageUrlParams().format("png").portalRequest(this.portalRequest).scale("max(300)").validate();
final String url = this.service.imageUrl(params);
assertEquals("/site/default/draft/a/b/mycontent/_/image/123456:8cf45815bba82c9711c673c9bb7304039a790026/max-300/mycontent.png", url);
}
use of com.enonic.xp.portal.url.ImageUrlParams in project xp by enonic.
the class PortalUrlServiceImpl_imageUrlTest method createUrl_withId.
@Test
public void createUrl_withId() {
createContent();
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/_/image/123456:8cf45815bba82c9711c673c9bb7304039a790026/max-300/mycontent", url);
}
use of com.enonic.xp.portal.url.ImageUrlParams in project xp by enonic.
the class PortalUrlServiceImpl_imageUrlTest method createUrl.
@Test
public void createUrl() {
this.portalRequest.setContent(createContent());
final ImageUrlParams params = new ImageUrlParams().portalRequest(this.portalRequest).scale("max(300)").validate();
final String url = this.service.imageUrl(params);
assertEquals("/site/default/draft/a/b/mycontent/_/image/123456:8cf45815bba82c9711c673c9bb7304039a790026/max-300/mycontent", url);
}
Aggregations