use of org.flywaydb.core.Flyway in project spring-boot by spring-projects.
the class FlywayAutoConfigurationTests method overrideLocationsList.
@Test
public void overrideLocationsList() throws Exception {
EnvironmentTestUtils.addEnvironment(this.context, "flyway.locations[0]:classpath:db/changelog", "flyway.locations[1]:classpath:db/migration");
registerAndRefresh(EmbeddedDataSourceConfiguration.class, FlywayAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
Flyway flyway = this.context.getBean(Flyway.class);
assertThat(flyway.getLocations()).containsExactly("classpath:db/changelog", "classpath:db/migration");
}
use of org.flywaydb.core.Flyway in project spring-boot by spring-projects.
the class FlywayAutoConfigurationTests method overrideLocations.
@Test
public void overrideLocations() throws Exception {
EnvironmentTestUtils.addEnvironment(this.context, "flyway.locations:classpath:db/changelog,classpath:db/migration");
registerAndRefresh(EmbeddedDataSourceConfiguration.class, FlywayAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
Flyway flyway = this.context.getBean(Flyway.class);
assertThat(flyway.getLocations()).containsExactly("classpath:db/changelog", "classpath:db/migration");
}
use of org.flywaydb.core.Flyway in project spring-boot by spring-projects.
the class FlywayAutoConfigurationTests method defaultFlyway.
@Test
public void defaultFlyway() throws Exception {
registerAndRefresh(EmbeddedDataSourceConfiguration.class, FlywayAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
Flyway flyway = this.context.getBean(Flyway.class);
assertThat(flyway.getLocations()).containsExactly("classpath:db/migration");
}
use of org.flywaydb.core.Flyway in project spring-boot by spring-projects.
the class FlywayAutoConfigurationTests method createDataSource.
@Test
public void createDataSource() throws Exception {
EnvironmentTestUtils.addEnvironment(this.context, "flyway.url:jdbc:hsqldb:mem:flywaytest", "flyway.user:sa");
registerAndRefresh(EmbeddedDataSourceConfiguration.class, FlywayAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
Flyway flyway = this.context.getBean(Flyway.class);
assertThat(flyway.getDataSource()).isNotNull();
}
use of org.flywaydb.core.Flyway in project spring-boot by spring-projects.
the class FlywayEndpoint method invoke.
@Override
public List<FlywayReport> invoke() {
List<FlywayReport> reports = new ArrayList<>();
for (Map.Entry<String, Flyway> entry : this.flyways.entrySet()) {
List<FlywayMigration> migrations = new ArrayList<>();
for (MigrationInfo info : entry.getValue().info().all()) {
migrations.add(new FlywayMigration(info));
}
reports.add(new FlywayReport(entry.getKey(), migrations));
}
return reports;
}
Aggregations