title: Spring boot test: @Sql annotation Unable to locate sql files placed in src/test/resources
body: <p>I didn't want to load the entire Spring Boot configuration for unit-testing my <code>DAO</code> layer, and therefore created a nested configuration class to <strong>suppress default configurations</strong>. But when I try to specify SQL scripts for it to run before tests, its unable to find them.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>package com.test.customer.controller;
  ..
  @RunWith(SpringRunner.class)
  @JdbcTest
  @Sql({"data.sql"})
  public class InterviewInformationControllerTest {
  
      @Configuration
      static class TestConfiguration{
  
      }
  
      @Test
      public void testCustomer() {
          // code
      }
  
  }
  
  I get the error: Cannot read SQL script from class path resource [com/test/customer/controller/data.sql]; nested exception is java.io.FileNotFoundException: class path resource [com/test/customer/controller/data.sql] cannot be opened because it does not exist
  </code></pre>
  
  <p>I've tried placing the file at both <code>src/main/resources</code> (not preferred) as well as at <code>src/test/resources</code> (which I prefer)</p>
  
  <p>Note: I'm running the Unit test from inside Eclipse by doing <code>Run as -&gt; JUnit test</code>.</p>
  
  <p><strong>Edit</strong>: Added the <code>static</code> keyword to the configuration class</p>