Question: I'm having a problem where IntelliJ 13.1.4, when running a unit test, can't find a `ServiceLoader` file in the `src/test/resources` directory of my module.

Please note before answering that I've done all of the following:

1. The module is a Gradle project, and if I run `gradle test` the unit test runs fine.
2. I've run this unit test successfully in IntelliJ in the past, and it found the module. (Maybe an earlier version of IntelliJ?)
3. I've double checked the IntelliJ module settings and the `src/test/resources` directory is marked as being a test resources directory. (See screenshot below.)
4. I'm dumping the unit test class's classloader's classpath in the class; it has the `build/classes/test/` and `build/classes/java` directories, but neither `build/resources/test/` nor `build/resources/main/`.
5. I've clicked the button to refresh all Gradle projects.

Any ideas on what else could be causing IntelliJ to fail here?

---

Screenshot of my module configuration, showing the Test Resource Folders setting.

![My Test Resource Folders is correctly set.](https://i.stack.imgur.com/ygHhH.png)

Answer: 
I recently encountered this where the junit test could not locate a resource in the `src/test/resources` directory.

I had a stray `<packaging>pom</packaging>` in the `pom.xml` file and taking it out solved it in my case.
I ran into the same issue, where Junit was failing(FileNotFound) because I had space in my root project folder. eg: my project/project1/.... 

* I removed the space from the root folder, my\_project/project1/ all test passed properly.