I am trying to set up a junit test that reads a pdf file to pass into my method, which takes a File parameters. The problem I'm having is that I can't seem to find the pdf file.
I need this to work both inside of eclipse as a single test and once the test has been zipped into a jar file for our automated build.
For simplicity, I've put the postcard.pdf right next to the junit test class. Here's the last thing I've tried.
URL url = getClass().getClassLoader().getResource("postcard.pdf");
URI uri = url.toURI();
File file = new File(uri);
javamailService.sendMessage(MAILUSER, REPLY_TO, SUBJECT, file, MimeType.pdf);
fail("Not yet implemented");
Help, please?