|
|
@ -288,6 +288,7 @@ class FlywayAutoConfigurationTests {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
|
|
|
|
@Deprecated
|
|
|
|
void checkLocationsAllMissing() {
|
|
|
|
void checkLocationsAllMissing() {
|
|
|
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
|
|
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
|
|
|
.withPropertyValues("spring.flyway.locations:classpath:db/missing1,classpath:db/migration2")
|
|
|
|
.withPropertyValues("spring.flyway.locations:classpath:db/missing1,classpath:db/migration2")
|
|
|
@ -299,6 +300,7 @@ class FlywayAutoConfigurationTests {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
|
|
|
|
@Deprecated
|
|
|
|
void checkLocationsAllExist() {
|
|
|
|
void checkLocationsAllExist() {
|
|
|
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
|
|
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
|
|
|
.withPropertyValues("spring.flyway.locations:classpath:db/changelog,classpath:db/migration")
|
|
|
|
.withPropertyValues("spring.flyway.locations:classpath:db/changelog,classpath:db/migration")
|
|
|
@ -306,6 +308,7 @@ class FlywayAutoConfigurationTests {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
|
|
|
|
@Deprecated
|
|
|
|
void checkLocationsAllExistWithImplicitClasspathPrefix() {
|
|
|
|
void checkLocationsAllExistWithImplicitClasspathPrefix() {
|
|
|
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
|
|
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
|
|
|
.withPropertyValues("spring.flyway.locations:db/changelog,db/migration")
|
|
|
|
.withPropertyValues("spring.flyway.locations:db/changelog,db/migration")
|
|
|
@ -313,12 +316,53 @@ class FlywayAutoConfigurationTests {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
|
|
|
|
@Deprecated
|
|
|
|
void checkLocationsAllExistWithFilesystemPrefix() {
|
|
|
|
void checkLocationsAllExistWithFilesystemPrefix() {
|
|
|
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
|
|
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
|
|
|
.withPropertyValues("spring.flyway.locations:filesystem:src/test/resources/db/migration")
|
|
|
|
.withPropertyValues("spring.flyway.locations:filesystem:src/test/resources/db/migration")
|
|
|
|
.run((context) -> assertThat(context).hasNotFailed());
|
|
|
|
.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
|
|
|
|
@Test
|
|
|
|
void customFlywayMigrationStrategy() {
|
|
|
|
void customFlywayMigrationStrategy() {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner
|
|
|
|