if the working directory for junit test is not properly set, the resource file might not be able to be loaded if relative path is used.
By default, Intellij uses project path as working directory. However if you have sub-modules which are in the sub directories, the junit test might have problem running locally.
To set it, go to the run/debug config and select the junit, you should be able to see the ‘working directory’ option there.
To set default, go to the run/debug config, click ‘default’ and select junit, in the ‘working directory’,set ‘$MODULE_DIR$‘