I understand. That makes sense. Your example was quite useful.
Thanks! John Kramer Java Software Engineer E-Commerce Web Team e: john.kra...@panerabread.com <mailto:john.kra...@panera.com> m: 314-435-2370 On 1/22/20, 13:35, "Daniel Klco" <dk...@apache.org> wrote: John, to clarify, the provided link was just an example of how one might import files into a mock Sling repository for Unit testing with Sling Mocks. I would not expect you to import it as a dependency in your project. On Wed, Jan 22, 2020 at 2:31 PM John Kramer <john.kra...@panerabread.com> wrote: > Looking at the maven repo, it looks like there is no test-jar built: > > > https://github.com/apache/sling-org-apache-sling-app-cms/blob/master/transformer/pom.xml > > I can pull down the source and push a test-jar to our local repo, but if > this is really the best way to implement this, this project should probably > build a test jar itself. > > John Kramer > Java Software Engineer > E-Commerce Web Team > e: john.kra...@panerabread.com <mailto:john.kra...@panera.com> > m: 314-435-2370 > > On 1/22/20, 13:02, "Daniel Klco" <dk...@apache.org> wrote: > > Warning: This email originated from outside of Panera. Beware of > clicking links and attachments. > > > 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 > > > > >