ImageImpl extends AbstractComponentImpl implements Image { @Override public String getSrc() { return src; } ImageImpl(); @Override String getSrc(); @Override boolean displayPopupTitle(); @Override String getAlt(); @Override String getTitle(); @Override String getLink(); @Override @JsonIgnore String getFileReference(); @Override @JsonIgnore @Deprecated String getJson(); @NotNull @Override String getExportedType(); @Override @JsonIgnore boolean isDecorative(); @Override Resource getDataLayerAssetResource(); @Override String getDataLayerTitle(); @Override String getDataLayerLinkUrl(); static final String RESOURCE_TYPE; }
@Test void testExtensionDeterminedFromMimetype() { context.contentPolicyMapping(com.adobe.cq.wcm.core.components.internal.models.v2.ImageImpl.RESOURCE_TYPE, "allowedRenditionWidths", new int[]{128,256,512,1024,1280,1440,1920,2048}, "uuidDisabled", true, "disableLazyLoading", false); String escapedResourcePath = IMAGE18_PATH.replace("jcr:content", "_jcr_content"); Image image = getImageUnderTest(IMAGE18_PATH); assertEquals(CONTEXT_PATH + escapedResourcePath + "." + selector + ".png/1490005239000/" + ASSET_NAME + ".png", image.getSrc()); Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, IMAGE18_PATH)); }
@Test void testImageCacheKiller() { context.contentPolicyMapping(com.adobe.cq.wcm.core.components.internal.models.v2.ImageImpl.RESOURCE_TYPE, "uuidDisabled", true); String escapedResourcePath = IMAGE15_PATH.replace("jcr:content", "_jcr_content"); Image image = getImageUnderTest(IMAGE15_PATH); assertEquals(CONTEXT_PATH + escapedResourcePath + "." + selector + ".png/1494867377756/adobe-systems-logo-and-wordmark.png", image.getSrc()); Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, IMAGE15_PATH)); }
@Test void testTIFFImage() { context.contentPolicyMapping(com.adobe.cq.wcm.core.components.internal.models.v2.ImageImpl.RESOURCE_TYPE, "uuidDisabled", true); String escapedResourcePath = IMAGE16_PATH.replace("jcr:content", "_jcr_content"); Image image = getImageUnderTest(IMAGE16_PATH); assertEquals(CONTEXT_PATH + escapedResourcePath + "." + selector + ".jpeg/1500299989000/" + ASSET_NAME + ".jpeg", image.getSrc()); Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, IMAGE16_PATH)); }