title: My file can't be loaded when i try to used as test resources
body: <p>Here is my project structure: I have an <code>xml file</code> that I need to use it with my <code>junit test case</code>, I don't know why I can not get this file.</p>
  
  <p>Even I mark the directory as test directory resources with intellij and there is no way.
  <a href="https://i.stack.imgur.com/5j4lW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5j4lW.png" alt="enter image description here"></a></p>
  
  <p>Here is my method:</p>
  
  <pre><code>@Before
      public void init() throws Exception {
  
          xml = IOUtils.toString(
                  this.getClass().getResourceAsStream("reponse.xml"),
                  "UTF-8"
          );
          ......
      }
  </code></pre>
  
  <p>I'm getting always the same error trace:</p>
  
  <pre><code>java.lang.NullPointerException
          at java.io.Reader.&lt;init&gt;(Reader.java:78)
          at java.io.InputStreamReader.&lt;init&gt;(InputStreamReader.java:113)
          at org.apache.commons.io.IOUtils.copy(IOUtils.java:1906)
          at org.apache.commons.io.IOUtils.toString(IOUtils.java:778)
          at org.apache.commons.io.IOUtils.toString(IOUtils.java:803)
          at fr.gouv.crpcen.restitution.ParserServiceTest.init(ParserServiceTest.java:113)
  </code></pre>