title: IntelliJ Cant Find Test Context
body: <p>I am having issues running unit tests in intelliJ. I have looked through other forums where people have had similar issues but so far I still haven't been able to get it to work. This is the error:</p>
  
  <pre><code>java.lang.IllegalStateException: Failed to load ApplicationContext
  ...
  Caused by: java.io.FileNotFoundException: class path resource [com/d1/d2/service/ServiceTest-context.xml] cannot be opened because it does not exist
  </code></pre>
  
  <p>In my test I have:</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @ContextConfiguration(locations = "ServiceTest-context.xml")
  public class ServiceImplTest ....
  </code></pre>
  
  <p>I have obviously verified that the file exists where it is looking for it in the caused by line. I also read a suggestion to check the output directory and I have verified that it exists there as well. Is there anything else that stands out to you? I can run the tests from the command line using ant but I would like to be able to run individual classes rather than modules.</p>
  
  <p>Project:</p>
  
  <pre><code>IntelliJ_project
      src
      test
          com
              d1
                  d2
                      otherStuff
                      ...
                      ...
                      service
                          ServiceImplTest.java
                          ServiceTest-context.xml
  </code></pre>
  
  <p>outputFolder:</p>
  
  <pre><code>test-classes (output folder)
      com
          d1
              d2
                  service
                      ServiceImplTest.class
  </code></pre>
  
  <p>So it turns out I was looking in the wrong directory for the output. The context file does not make it to the output location. How do I get it there?</p>