On Tue, May 05, 2020 at 02:22:28PM +1200, Kim Shepherd wrote:
> Whoops, meant to mention the other approach, in src/test/resources eg for
> mediafilter:
>
> source = getClass().getResourceAsStream("wordtest.doc");
>
> Perhaps that is actually more straight-forward..
>
> On Tue, 5 May 2020 at 14:14, Kim Shepherd <
k...@shepherd.nz> wrote:
>
> > Hi DSpace 7 devs (and all),
> >
> > Is there a best practice for including external resources for unit tests?
> >
> > In my case I want to test that some known valid JSON from the SHERPA API
> > is parsed properly by our SHERPA integration code. It looks like the best
> > way for me is to store it in src/test/data/.../ and refer to it in the
> > resources/test-config.properties file, the way test.bitstream is
> > handled... but just thought I'd check this since there don't seem to be too
> > many other precedents like that..
the unit under test. If a class' job is to open and read an external
has to live somewhere outside of any JAR. If the class' job is to
Mark H. Wood
755 W. Michigan Street