title: Travis CI + Maven + Junit getClass().getResourceAsStream() not working
body: <p>I am working on a Java Maven project and am using Travis CI. I am trying to read am image file as InputStream from a Junit Test class using the following code</p>
  
  <pre><code>InputStream in = getClass().getResourceAsStream("treadmill.jpg");
  </code></pre>
  
  <p>The image file is stored in the same package as the Junit Test file. This code works on my local Windows 10 system but it returns null in Travis CI. </p>
  
  <p><code>.travis.yml</code> config file</p>
  
  <pre><code>language: java
  services:
  - mysql
  before_install:
  - mysql -u root &lt; db_schema/dbschema.sql
  - mysql -u root -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('somepassword');"
  </code></pre>
  
  <p>I have also looked at <a href="https://stackoverflow.com/questions/37636089/travis-ci-and-junit-with-gradle-cannot-find-classpath-resources">Travis CI and JUnit with Gradle cannot find classpath resources</a>. </p>
  
  <p>Any help will be appreciated.</p>