mercredi 26 avril 2017

Spring Boot tests always running schema-${platform}.sql

When I run tests on Spring Boot the both schema-${platform}.sql and data-${platform}.sql is running.

In my scenario I have to remove the schema.sql from tests and set the datasource property datasource.jpa.hibernate.ddl-auto=update. When I remove the 'Schema 2' from test folder the 'Schema 1' keep running.

I have the following directory structure:

├───src
│   ├───main
│   │   └───resources
│   │       ├───locale
│   │       └───static
│   │       └data-mysql.sql
│   │       └schema-mysql.sql //Schema 1
│   └───test
│       └───resources
│          └data-mysql.sql
│          └schema-mysql.sql //Schema 2

-> Both Schema 1 and Schema 2 has the same sql instructions.

Is there anyway to keep the data-mysql.sql on tests folder, remove the schema-mysql.sql from test folder and the tests not run the 'Schema 1'?

Aucun commentaire:

Enregistrer un commentaire