title: Spring boot test H2 sql script not being loaded
body: <p>So i'm having problems trying to make my test loading the .sql script for schema and data.</p>
  <p>By default my scripts are not being loaded, cause when my test try to get the data from the H2 db, show the message &quot;Table &quot;&quot; not found&quot;.</p>
  <p>The scripts are in the &quot;src/test/resources&quot; folder.
  H2 dependency in pom:</p>
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.h2database&lt;/groupId&gt;
      &lt;artifactId&gt;h2&lt;/artifactId&gt;
      &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>And when i put the annotation &quot;@Sql(scripts = { &quot;/schema.sql&quot;, &quot;/data.sql&quot; }), i see the next error:</p>
  <blockquote>
  <p>java.lang.IllegalStateException: Failed to execute SQL scripts for
  test context [DefaultTestContext@7090eaec testClass =
  MicroserviceControllerTest, testInstance =
  sche.invm.backend.rke.asn2019.get.controller.MicroserviceControllerTest@180274b1,
  testMethod = testGetPerson@MicroserviceControllerTest, testException =
  [null], mergedContextConfiguration =
  [WebMergedContextConfiguration@5158e446 testClass =
  MicroserviceControllerTest, locations = '{}', classes = '{class
  sche.invm.backend.rke.asn2019.get.GetApplication}',
  contextInitializerClasses = '[]', activeProfiles = '{test}',
  propertySourceLocations = '{}', propertySourceProperties =
  '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true,
  server.port=0}', contextCustomizers =
  set[org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@30bbcf91,
  org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@52b959df,
  org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0,
  org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@31834a2b,
  org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0,
  org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@34c53688,
  org.springframework.boot.test.context.SpringBootTestArgs@1,
  org.springframework.boot.test.context.SpringBootTestWebEnvironment@6127a7e],
  resourceBasePath = 'src/main/webapp', contextLoader =
  'org.springframework.boot.test.context.SpringBootContextLoader',
  parent = [null]], attributes =
  map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener'
  -&gt; false]]: could not obtain DataSource from transaction manager [org.springframework.orm.jpa.JpaTransactionManager] (named '').</p>
  </blockquote>
  <p>This is the configuration of my test:
  <a href="https://i.stack.imgur.com/O8vHY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O8vHY.png" alt="enter image description here" /></a></p>
  <p>This is the configuration of my test with the @Sql annotation:
  <a href="https://i.stack.imgur.com/mxtPx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mxtPx.png" alt="enter image description here" /></a></p>
  <p>¿What it can be the error?
  My app is configured with multitenant, i don't know if something of this can be causing this particular error.</p>