title: Spring boot test not picking up hbm.xml files from src/main/resources
body: <p>We have a project on spring-boot version 1.5.2.RELEASE.</p>
  
  <p>We need to work on hibernate named queries in xml (Named queries in java annotation is not an option for us). </p>
  
  <p>For this purpose we have added all our <code>hbm.xml</code> files (which contains these named queries) in <code>src/main/resources</code> directory.</p>
  
  <p>This is not a problem when our application is running. The named queries gets picked up correctly.</p>
  
  <p>However, when we write the integration test cases, it is not able to recognize the named queries.</p>
  
  <p>We get: </p>
  
  <blockquote>
    <p>Named Query not found exception</p>
  </blockquote>
  
  <p>Below is our test case code:</p>
  
  <pre><code>@RunWith(SpringRunner.class)
  @SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
  public class MyIntegrationTest {
      @Autowired
      private TestRestTemplate template;
  
      @Test 
      public void checkRestService() throws Exception {
          ResponseEntity&lt;String&gt; response = template.getForEntity("/hello/1", String.class);
          assertTrue(response.getStatusCodeValue() == 200);
      }
  }
  </code></pre>
  
  <p>If we copy the <code>hbm.xml</code> files in <code>src/test/resources directory</code>, the <code>hbm.xml</code> files gets picked up correctly and the test runs correctly.</p>
  
  <p>Is there anyway that the xml files gets picked up directly from <code>src/main/resouces</code> folder and we don't have to copy these files?</p>