At runtime, that file doesn't live in test/resources. Your build system/IDE will have put it inside a Jar, or somewhere in your classes/ directory. Either way, it will only be accessible via the classpath; getResourceAsStream()
abstracts that away, so that's what you should be using.
If you really need a filename (i.e. if that's an unavoidable aspect of how your class works*), then you should consider using JUnit's @TemporaryFolder
rule; have your test setup copy the contents of the resource file into a temporary file, and then pass the name of that to your constructor.
* And that sounds like a design flaw, you should consider rewriting your class to work with abstractions.