Search in sources :

Example 11 with SpringLiquibase

use of liquibase.integration.spring.SpringLiquibase in project spring-boot by spring-projects.

the class LiquibaseAutoConfigurationTests method testDefaultSpringLiquibase.

@Test
public void testDefaultSpringLiquibase() throws Exception {
    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-master.yaml");
    assertThat(liquibase.getContexts()).isNull();
    assertThat(liquibase.getDefaultSchema()).isNull();
    assertThat(liquibase.isDropFirst()).isFalse();
}
Also used : SpringLiquibase(liquibase.integration.spring.SpringLiquibase) Test(org.junit.Test)

Example 12 with SpringLiquibase

use of liquibase.integration.spring.SpringLiquibase in project spring-boot by spring-projects.

the class LiquibaseAutoConfigurationTests method testOverrideContexts.

@Test
public void testOverrideContexts() throws Exception {
    EnvironmentTestUtils.addEnvironment(this.context, "liquibase.contexts:test, production");
    this.context.register(EmbeddedDataSourceConfiguration.class, LiquibaseAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
    SpringLiquibase liquibase = this.context.getBean(SpringLiquibase.class);
    assertThat(liquibase.getContexts()).isEqualTo("test, production");
}
Also used : SpringLiquibase(liquibase.integration.spring.SpringLiquibase) Test(org.junit.Test)

Example 13 with SpringLiquibase

use of liquibase.integration.spring.SpringLiquibase in project spring-boot by spring-projects.

the class LiquibaseAutoConfigurationTests method testOverrideLabels.

@Test
public void testOverrideLabels() throws Exception {
    EnvironmentTestUtils.addEnvironment(this.context, "liquibase.labels:test, production");
    this.context.register(EmbeddedDataSourceConfiguration.class, LiquibaseAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
    SpringLiquibase liquibase = this.context.getBean(SpringLiquibase.class);
    assertThat(liquibase.getLabels()).isEqualTo("test, production");
}
Also used : SpringLiquibase(liquibase.integration.spring.SpringLiquibase) Test(org.junit.Test)

Example 14 with SpringLiquibase

use of liquibase.integration.spring.SpringLiquibase in project spring-boot by spring-projects.

the class LiquibaseAutoConfigurationTests method testLiquibaseDataSource.

@Test
public void testLiquibaseDataSource() {
    this.context.register(LiquibaseDataSourceConfiguration.class, EmbeddedDataSourceConfiguration.class, LiquibaseAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
    SpringLiquibase liquibase = this.context.getBean(SpringLiquibase.class);
    assertThat(liquibase.getDataSource()).isEqualTo(this.context.getBean("liquibaseDataSource"));
}
Also used : SpringLiquibase(liquibase.integration.spring.SpringLiquibase) Test(org.junit.Test)

Aggregations

SpringLiquibase (liquibase.integration.spring.SpringLiquibase)14 Test (org.junit.Test)13 Map (java.util.Map)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 DataSource (javax.sql.DataSource)1 StandardChangeLogHistoryService (liquibase.changelog.StandardChangeLogHistoryService)1 Database (liquibase.database.Database)1 DatabaseFactory (liquibase.database.DatabaseFactory)1 JdbcConnection (liquibase.database.jvm.JdbcConnection)1 LiquibaseReport (org.springframework.boot.actuate.endpoint.LiquibaseEndpoint.LiquibaseReport)1