IntelliJ Idea loses my test resources!


Are your tests failing because the resource files cannot be found? All of the sudden I hit this problem where a few of my tests started to fail for no reason. They were unable to locate the test resources I was using and at first this looked like an ancient issue. The old issue I had been familiar with before involved a clumsy work-around where you would hack your Gradle build to copy the test resources folder into the test classes folder. This still works but is not necessary. While the bug still exists the current work around is to click the Gradle sync button to resynchronize your project with the Gradle build. (I discovered the fix here.) This seems to work for me for now.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s