Skip to content

Commit 4c7c328

Browse files
committed
Polish "Upgrade to Liquibase 3.6.2"
Closes gh-13625
1 parent b5cb074 commit 4c7c328

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import org.springframework.context.annotation.Bean;
4747
import org.springframework.context.annotation.Configuration;
4848
import org.springframework.context.annotation.Primary;
49+
import org.springframework.jdbc.core.JdbcTemplate;
4950
import org.springframework.test.util.ReflectionTestUtils;
5051
import org.springframework.util.FileCopyUtils;
5152

@@ -143,6 +144,32 @@ public void overrideDefaultSchema() {
143144
.isEqualTo("public")));
144145
}
145146

147+
@Test
148+
public void overrideLiquibaseInfrastructure() {
149+
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
150+
.withPropertyValues("spring.liquibase.liquibase-schema:public",
151+
"spring.liquibase.liquibase-tablespace:infra",
152+
"spring.liquibase.database-change-log-table:LIQUI_LOG",
153+
"spring.liquibase.database-change-log-lock-table:LIQUI_LOCK")
154+
.run((context) -> {
155+
SpringLiquibase liquibase = context.getBean(SpringLiquibase.class);
156+
assertThat(liquibase.getLiquibaseSchema()).isEqualTo("public");
157+
assertThat(liquibase.getLiquibaseTablespace()).isEqualTo("infra");
158+
assertThat(liquibase.getDatabaseChangeLogTable())
159+
.isEqualTo("LIQUI_LOG");
160+
assertThat(liquibase.getDatabaseChangeLogLockTable())
161+
.isEqualTo("LIQUI_LOCK");
162+
JdbcTemplate jdbcTemplate = new JdbcTemplate(
163+
context.getBean(DataSource.class));
164+
assertThat(jdbcTemplate.queryForObject(
165+
"SELECT COUNT(*) FROM public.LIQUI_LOG", Integer.class))
166+
.isEqualTo(1);
167+
assertThat(jdbcTemplate.queryForObject(
168+
"SELECT COUNT(*) FROM public.LIQUI_LOCK", Integer.class))
169+
.isEqualTo(1);
170+
});
171+
}
172+
146173
@Test
147174
public void overrideDropFirst() {
148175
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)

0 commit comments

Comments
 (0)