So i'm having problems trying to make my test loading the .sql script for schema and data.
By default my scripts are not being loaded, cause when my test try to get the data from the H2 db, show the message "Table "" not found".
The scripts are in the "src/test/resources" folder. H2 dependency in pom:
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
And when i put the annotation "@Sql(scripts = { "/schema.sql", "/data.sql" }), i see the next error:
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' -> false]]: could not obtain DataSource from transaction manager [org.springframework.orm.jpa.JpaTransactionManager] (named '').
This is the configuration of my test:
This is the configuration of my test with the @Sql annotation:
¿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.