src/test/resources
instead.
src/test/java
and then put the TIFF into src/test/resources
and then it will keep working. Alternately, you can use just hardcode a relative file path to ../../../../../data/mt.tif
or whatever instead of using Class.getResource
. If it's in your test code, it isn't very important.