use of com.day.cq.commons.ImageResource in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class MockCommerceFactory method getProduct.
public static Product getProduct(Resource resource) {
Product product = mock(Product.class);
when(product.getPath()).thenReturn(resource.getPath());
Resource image = resource.getChild("image");
if (image != null) {
ImageResource imageResource = new ImageResource(image);
when(product.getImage()).thenReturn(imageResource);
}
return product;
}
Aggregations