use of com.adobe.cq.wcm.core.components.commons.editor.dialog.inherited.PageImageThumbnail in project aem-core-wcm-components by adobe.
the class PageImageThumbnailTest method testPageImageThumbnailWithLinkURL.
@Test
void testPageImageThumbnailWithLinkURL() {
context.currentResource(RESOURCE);
MockSlingHttpServletRequest request = context.request();
request.setParameterMap(ImmutableMap.of("item", RESOURCE, "pageLink", "/content/page1"));
PageImageThumbnail pageImageThumbnail = request.adaptTo(PageImageThumbnail.class);
if (pageImageThumbnail != null) {
assertEquals("featured image alt for page 1", pageImageThumbnail.getAlt(), "getAlt()");
assertEquals("/content/page1/_jcr_content/_cq_featuredimage.coreimg.png", pageImageThumbnail.getSrc(), "getSrc()");
}
}
use of com.adobe.cq.wcm.core.components.commons.editor.dialog.inherited.PageImageThumbnail in project aem-core-wcm-components by adobe.
the class PageImageThumbnailTest method testWithTeaserAndNoLink.
@Test
void testWithTeaserAndNoLink() {
context.currentResource(TEASER1);
MockSlingHttpServletRequest request = context.request();
request.setParameterMap(ImmutableMap.of("item", TEASER1));
PageImageThumbnail pageImageThumbnail = request.adaptTo(PageImageThumbnail.class);
if (pageImageThumbnail != null) {
assertEquals("featured image alt", pageImageThumbnail.getAlt(), "getAlt()");
assertEquals("/content/page/_jcr_content/_cq_featuredimage.coreimg.png", pageImageThumbnail.getSrc(), "getSrc()");
}
}
Aggregations