title: Access file in JUnit test in Gradle environment
body: <p>Right now I have got a Java library which has a test class. In that class I want to access some files located on my hard disk.</p>
  
  <p>The build.gradle looks like this:</p>
  
  <pre><code>apply plugin: 'java'
  
  dependencies {
      testCompile 'junit:junit:4.11'
  }
  </code></pre>
  
  <p>My file is under <code>java_lib/src/test/assets/file.xml</code> and the Java class is under <code>java_lib/src/test/java/&lt;package_name&gt;.java</code></p>
  
  <p>Therefore I execute</p>
  
  <p><code>final InputStream resourceAsStream = this.getClass().getResourceAsStream("assets/file.xml");</code></p>
  
  <p>Unfortunately I get null back. What am I doing wrong?</p>