I need to pass a File to a class for unit tests. The class requires a File specifically, and can't be modified - it just reads it. (So I don't want to try to mock out that class or modify it - just pass it the File it needs.)
What's the recommended way to do this?
I put the file in src/test/resources/...
and just passed that entire path in, and, since the test is run in the project root dir, this works. But this seems quite wrong.
UPDATE: To emphasize - the class needs a File object, not an InputStream or anything else.