I have two files under the following folder hierarchy src/test/resources/folderA/fileA
and src/test/resources/folderA/fileB
. I have a reference to these files from the application.properties
under test resources (src/test/resources/application.properties
). The reference is the following:
propertyA=classpath:/folderA/fileB
propertyA=classpath:/folderA/fileA
Unfortunately this is apparently not working. It breaks with the following exception:
Caused by: java.io.FileNotFoundException: classpath:/folderA/fileA (No such file or directory)
I have tried also the following:
propertyA=classpath:folderA/fileB
propertyA=/folderA/fileB
propertyA=folderA/fileB
and they are also not working. So what is the appropriate way to refer a resource file from test application properties in order to be property loaded?