Assuming you are using Sling Mocks, you can load the file in as a resource
into the Sling Context, see:
https://github.com/apache/sling-org-apache-sling-app-cms/blob/master/transformer/src/test/java/org/apache/sling/cms/transformer/helpers/SlingCMSContextHelper.java

https://sling.apache.org/documentation/development/sling-mock.html

On Wed, Jan 22, 2020 at 1:44 PM John Kramer <john.kra...@panerabread.com>
wrote:

> Hi guys,
>
> I need to build an org.apache.sling.api.resource.Resource obect from a
> file (specifically a .png file) for the purpose of unit testing.
>
> How do I do that?
>
> Thanks!
>
> John Kramer
> Java Software Engineer
> E-Commerce Web Team
> e: john.kra...@panerabread.com<mailto:john.kra...@panera.com>
> m: 314-435-2370
>

Reply via email to