|
|
|
|
@ -288,6 +288,7 @@ class FlywayAutoConfigurationTests {
@@ -288,6 +288,7 @@ class FlywayAutoConfigurationTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
@Deprecated |
|
|
|
|
void checkLocationsAllMissing() { |
|
|
|
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) |
|
|
|
|
.withPropertyValues("spring.flyway.locations:classpath:db/missing1,classpath:db/migration2") |
|
|
|
|
@ -299,6 +300,7 @@ class FlywayAutoConfigurationTests {
@@ -299,6 +300,7 @@ class FlywayAutoConfigurationTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
@Deprecated |
|
|
|
|
void checkLocationsAllExist() { |
|
|
|
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) |
|
|
|
|
.withPropertyValues("spring.flyway.locations:classpath:db/changelog,classpath:db/migration") |
|
|
|
|
@ -306,6 +308,7 @@ class FlywayAutoConfigurationTests {
@@ -306,6 +308,7 @@ class FlywayAutoConfigurationTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
@Deprecated |
|
|
|
|
void checkLocationsAllExistWithImplicitClasspathPrefix() { |
|
|
|
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) |
|
|
|
|
.withPropertyValues("spring.flyway.locations:db/changelog,db/migration") |
|
|
|
|
@ -313,12 +316,53 @@ class FlywayAutoConfigurationTests {
@@ -313,12 +316,53 @@ class FlywayAutoConfigurationTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
@Deprecated |
|
|
|
|
void checkLocationsAllExistWithFilesystemPrefix() { |
|
|
|
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) |
|
|
|
|
.withPropertyValues("spring.flyway.locations:filesystem:src/test/resources/db/migration") |
|
|
|
|
.run((context) -> assertThat(context).hasNotFailed()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void failOnMissingLocationsAllMissing() { |
|
|
|
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) |
|
|
|
|
.withPropertyValues("spring.flyway.check-location=false", |
|
|
|
|
"spring.flyway.fail-on-missing-locations=true") |
|
|
|
|
.withPropertyValues("spring.flyway.locations:classpath:db/missing1,classpath:db/migration2") |
|
|
|
|
.run((context) -> { |
|
|
|
|
assertThat(context).hasFailed(); |
|
|
|
|
assertThat(context).getFailure().isInstanceOf(BeanCreationException.class); |
|
|
|
|
assertThat(context).getFailure().hasMessageContaining("Unable to resolve location"); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void failOnMissingLocationsAllExist() { |
|
|
|
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) |
|
|
|
|
.withPropertyValues("spring.flyway.check-location=false", |
|
|
|
|
"spring.flyway.fail-on-missing-locations=true") |
|
|
|
|
.withPropertyValues("spring.flyway.locations:classpath:db/changelog,classpath:db/migration") |
|
|
|
|
.run((context) -> assertThat(context).hasNotFailed()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void failOnMissingLocationsAllExistWithImplicitClasspathPrefix() { |
|
|
|
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) |
|
|
|
|
.withPropertyValues("spring.flyway.check-location=false", |
|
|
|
|
"spring.flyway.fail-on-missing-locations=true") |
|
|
|
|
.withPropertyValues("spring.flyway.locations:db/changelog,db/migration") |
|
|
|
|
.run((context) -> assertThat(context).hasNotFailed()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void failOnMissingLocationsAllExistWithFilesystemPrefix() { |
|
|
|
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) |
|
|
|
|
.withPropertyValues("spring.flyway.check-location=false", |
|
|
|
|
"spring.flyway.fail-on-missing-locations=true") |
|
|
|
|
.withPropertyValues("spring.flyway.locations:filesystem:src/test/resources/db/migration") |
|
|
|
|
.run((context) -> assertThat(context).hasNotFailed()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void customFlywayMigrationStrategy() { |
|
|
|
|
this.contextRunner |
|
|
|
|
|