Commit 4c7c3289 authored by Stephane Nicoll's avatar Stephane Nicoll

Polish "Upgrade to Liquibase 3.6.2"

Closes gh-13625
parent b5cb0742
...@@ -46,6 +46,7 @@ import org.springframework.boot.testsupport.Assume; ...@@ -46,6 +46,7 @@ import org.springframework.boot.testsupport.Assume;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.util.ReflectionTestUtils; import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.util.FileCopyUtils; import org.springframework.util.FileCopyUtils;
...@@ -143,6 +144,32 @@ public class LiquibaseAutoConfigurationTests { ...@@ -143,6 +144,32 @@ public class LiquibaseAutoConfigurationTests {
.isEqualTo("public"))); .isEqualTo("public")));
} }
@Test
public void overrideLiquibaseInfrastructure() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues("spring.liquibase.liquibase-schema:public",
"spring.liquibase.liquibase-tablespace:infra",
"spring.liquibase.database-change-log-table:LIQUI_LOG",
"spring.liquibase.database-change-log-lock-table:LIQUI_LOCK")
.run((context) -> {
SpringLiquibase liquibase = context.getBean(SpringLiquibase.class);
assertThat(liquibase.getLiquibaseSchema()).isEqualTo("public");
assertThat(liquibase.getLiquibaseTablespace()).isEqualTo("infra");
assertThat(liquibase.getDatabaseChangeLogTable())
.isEqualTo("LIQUI_LOG");
assertThat(liquibase.getDatabaseChangeLogLockTable())
.isEqualTo("LIQUI_LOCK");
JdbcTemplate jdbcTemplate = new JdbcTemplate(
context.getBean(DataSource.class));
assertThat(jdbcTemplate.queryForObject(
"SELECT COUNT(*) FROM public.LIQUI_LOG", Integer.class))
.isEqualTo(1);
assertThat(jdbcTemplate.queryForObject(
"SELECT COUNT(*) FROM public.LIQUI_LOCK", Integer.class))
.isEqualTo(1);
});
}
@Test @Test
public void overrideDropFirst() { public void overrideDropFirst() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment