use of liquibase.integration.spring.SpringLiquibase in project spring-boot by spring-projects.
the class LiquibaseAutoConfigurationTests method testJsonChangeLog.
@Test
public void testJsonChangeLog() throws Exception {
EnvironmentTestUtils.addEnvironment(this.context, "liquibase.change-log:classpath:/db/changelog/db.changelog-override.json");
this.context.register(EmbeddedDataSourceConfiguration.class, LiquibaseAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
this.context.refresh();
SpringLiquibase liquibase = this.context.getBean(SpringLiquibase.class);
assertThat(liquibase.getChangeLog()).isEqualTo("classpath:/db/changelog/db.changelog-override.json");
}
use of liquibase.integration.spring.SpringLiquibase in project spring-boot by spring-projects.
the class LiquibaseAutoConfigurationTests method testOverrideDefaultSchema.
@Test
public void testOverrideDefaultSchema() throws Exception {
EnvironmentTestUtils.addEnvironment(this.context, "liquibase.default-schema:public");
this.context.register(EmbeddedDataSourceConfiguration.class, LiquibaseAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
this.context.refresh();
SpringLiquibase liquibase = this.context.getBean(SpringLiquibase.class);
assertThat(liquibase.getDefaultSchema()).isEqualTo("public");
}
use of liquibase.integration.spring.SpringLiquibase in project spring-boot by spring-projects.
the class LiquibaseAutoConfigurationTests method testSqlChangeLog.
@Test
public void testSqlChangeLog() throws Exception {
EnvironmentTestUtils.addEnvironment(this.context, "liquibase.change-log:classpath:/db/changelog/db.changelog-override.sql");
this.context.register(EmbeddedDataSourceConfiguration.class, LiquibaseAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
this.context.refresh();
SpringLiquibase liquibase = this.context.getBean(SpringLiquibase.class);
assertThat(liquibase.getChangeLog()).isEqualTo("classpath:/db/changelog/db.changelog-override.sql");
}
use of liquibase.integration.spring.SpringLiquibase in project spring-boot by spring-projects.
the class LiquibaseAutoConfigurationTests method testLogger.
@Test
public void testLogger() throws Exception {
this.context.register(EmbeddedDataSourceConfiguration.class, LiquibaseAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
this.context.refresh();
SpringLiquibase liquibase = this.context.getBean(SpringLiquibase.class);
Object log = ReflectionTestUtils.getField(liquibase, "log");
assertThat(log).isInstanceOf(CommonsLoggingLiquibaseLogger.class);
assertThat(this.outputCapture.toString()).doesNotContain(": liquibase:");
}
use of liquibase.integration.spring.SpringLiquibase in project spring-boot by spring-projects.
the class LiquibaseAutoConfigurationTests method testOverrideParameters.
@Test
@SuppressWarnings("unchecked")
public void testOverrideParameters() throws Exception {
EnvironmentTestUtils.addEnvironment(this.context, "liquibase.parameters.foo:bar");
this.context.register(EmbeddedDataSourceConfiguration.class, LiquibaseAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
this.context.refresh();
SpringLiquibase liquibase = this.context.getBean(SpringLiquibase.class);
Map<String, String> parameters = (Map<String, String>) ReflectionTestUtils.getField(liquibase, "parameters");
assertThat(parameters.containsKey("foo")).isTrue();
assertThat(parameters.get("foo")).isEqualTo("bar");
}
Aggregations