I've been trying to disable Flyway for my unit tests on Spring Boot 2, but could not succeed.
I understand, from Spring Boot's documentation, that the property for doing so changed from flyway.enabled
to spring.flyway.enabled
, and added that to my test application profile (as below).
spring:
datasource:
url: jdbc:h2:mem:db
jpa:
hibernate:
ddl-auto: create
flyway:
enabled: false
This configuration appears to have no effect at all, and Flyway auto-configuration is still invoked.
I also tried creating a separate auto-configuration class for the unit tests only, where I added @EnableAutoConfiguration(exclude = FlywayAutoConfiguration.class)
, but this try failed as much as the previous one.