I have a JUnit test located within my project package in the location:
Java Resources > unittests > ActionTest.java
I am trying to use an InputStream in one of my tests that would take in a static file located in another part of my project package:
WebRoot > TestFiles > sampleFile.txt
Is there a way to go about passing the classpath of the file to the InputStream somehow? Or will I need to move the sampleFile.txt somewhere else within my project?
I have tried defining the InputStream like so:
InputStream fileStream = getClass().getResourceAsStream("sampleValidPatientList.txt");