Search in sources :

Example 11 with Image

use of com.adobe.cq.wcm.core.components.models.Image in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class ImageImplTest method testInheritedPageImage_withWrongLink.

@Test
protected void testInheritedPageImage_withWrongLink() {
    Image image = getImageUnderTest(PAGE0_IMAGE3_PATH);
    Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, PAGE0_IMAGE3_PATH));
}
Also used : Image(com.adobe.cq.wcm.core.components.models.Image) AbstractImageTest(com.adobe.cq.wcm.core.components.internal.models.v1.AbstractImageTest) Test(org.junit.jupiter.api.Test)

Example 12 with Image

use of com.adobe.cq.wcm.core.components.models.Image in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class ImageImplTest method testEmptyImage_emptyFeaturedImage_inherit.

@Test
protected void testEmptyImage_emptyFeaturedImage_inherit() {
    Image image = getImageUnderTest(PAGE0_IMAGE1_PATH);
    assertNull(image.getSrc(), "getSrc()");
    assertNull(image.getAlt(), "getAlt()");
    assertNull(image.getFileReference(), "getFileReference()");
    assertNull(image.getUuid(), "getUuid()");
    assertEquals("image-61631780d5", image.getId(), "getId()");
    Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, PAGE0_IMAGE1_PATH));
}
Also used : Image(com.adobe.cq.wcm.core.components.models.Image) AbstractImageTest(com.adobe.cq.wcm.core.components.internal.models.v1.AbstractImageTest) Test(org.junit.jupiter.api.Test)

Example 13 with Image

use of com.adobe.cq.wcm.core.components.models.Image in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class ImageImplTest method testImageWithLazyThreshold.

@Test
void testImageWithLazyThreshold() {
    context.contentPolicyMapping(resourceType, Image.PN_DESIGN_LAZY_THRESHOLD, 100);
    Image image = getImageUnderTest(AbstractImageTest.IMAGE3_PATH);
    assertEquals(0, image.getLazyThreshold());
}
Also used : Image(com.adobe.cq.wcm.core.components.models.Image) AbstractImageTest(com.adobe.cq.wcm.core.components.internal.models.v1.AbstractImageTest) Test(org.junit.jupiter.api.Test)

Example 14 with Image

use of com.adobe.cq.wcm.core.components.models.Image in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class ImageImplTest method testInheritedPageImage_fromTemplate_noLink.

@Test
protected void testInheritedPageImage_fromTemplate_noLink() {
    Image image = getImageUnderTest(TEMPLATE_IMAGE_INHERITED_PATH1);
    Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, TEMPLATE_IMAGE_INHERITED_PATH1));
}
Also used : Image(com.adobe.cq.wcm.core.components.models.Image) AbstractImageTest(com.adobe.cq.wcm.core.components.internal.models.v1.AbstractImageTest) Test(org.junit.jupiter.api.Test)

Example 15 with Image

use of com.adobe.cq.wcm.core.components.models.Image in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class ImageImplTest method testEmptyImageDelegatingToFeaturedImage.

@Test
protected void testEmptyImageDelegatingToFeaturedImage() {
    Image image = getImageUnderTest(IMAGE50_PATH);
    assertEquals("/core/content/test/_jcr_content/root/image50.coreimg.png/1490005239000/adobe-systems-logo-and-wordmark.png", image.getSrc(), "getSrc()");
    assertEquals("Adobe Systems Logo and Wordmark in PNG format", image.getAlt(), "getAlt()");
    assertEquals("/content/dam/core/images/Adobe_Systems_logo_and_wordmark.png", image.getFileReference(), "getFileReference()");
    assertEquals("60a1a56e-f3f4-4021-a7bf-ac7a51f0ffe5", image.getUuid(), "getUuid()");
    assertEquals("image-cf7954fac5", image.getId(), "getId()");
    Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, IMAGE50_PATH));
}
Also used : Image(com.adobe.cq.wcm.core.components.models.Image) AbstractImageTest(com.adobe.cq.wcm.core.components.internal.models.v1.AbstractImageTest) Test(org.junit.jupiter.api.Test)

Aggregations

Image (com.adobe.cq.wcm.core.components.models.Image)84 Test (org.junit.jupiter.api.Test)57 AbstractImageTest (com.adobe.cq.wcm.core.components.internal.models.v1.AbstractImageTest)46 Test (org.junit.Test)5 Matchers.anyString (org.mockito.Matchers.anyString)5 Page (com.day.cq.wcm.api.Page)3 PageManager (com.day.cq.wcm.api.PageManager)3 Resource (org.apache.sling.api.resource.Resource)3 Link (com.adobe.cq.wcm.core.components.commons.link.Link)2 LinkHandler (com.adobe.cq.wcm.core.components.internal.link.LinkHandler)2 CoreResourceWrapper (com.adobe.cq.wcm.core.components.internal.resource.CoreResourceWrapper)2 ImageArea (com.adobe.cq.wcm.core.components.models.ImageArea)2 Teaser (com.adobe.cq.wcm.core.components.models.Teaser)2 DownloadResource (com.day.cq.commons.DownloadResource)2 ImageResource (com.day.cq.commons.ImageResource)2 Template (com.day.cq.wcm.api.Template)2 Style (com.day.cq.wcm.api.designer.Style)2 StringReader (java.io.StringReader)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2