Commit c7eec5c4 authored by Stephane Nicoll's avatar Stephane Nicoll

Polish "Add liquibase test rollback on update property"

Closes gh-13159
parent 08279c88
...@@ -203,4 +203,5 @@ public class LiquibaseProperties { ...@@ -203,4 +203,5 @@ public class LiquibaseProperties {
public void setTestRollbackOnUpdate(boolean testRollbackOnUpdate) { public void setTestRollbackOnUpdate(boolean testRollbackOnUpdate) {
this.testRollbackOnUpdate = testRollbackOnUpdate; this.testRollbackOnUpdate = testRollbackOnUpdate;
} }
} }
...@@ -178,6 +178,18 @@ public class LiquibaseAutoConfigurationTests { ...@@ -178,6 +178,18 @@ public class LiquibaseAutoConfigurationTests {
})); }));
} }
@Test
public void overrideTestRollbackOnUpdate() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues(
"spring.liquibase.test-rollback-on-update:true")
.run((context) -> {
SpringLiquibase liquibase = context.getBean(SpringLiquibase.class);
assertThat(liquibase.isTestRollbackOnUpdate()).isTrue();
});
}
@Test @Test
public void changeLogDoesNotExist() { public void changeLogDoesNotExist() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
...@@ -238,17 +250,6 @@ public class LiquibaseAutoConfigurationTests { ...@@ -238,17 +250,6 @@ public class LiquibaseAutoConfigurationTests {
}); });
} }
@Test
public void testRollbackOnUpdate() throws IOException {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues(
"spring.liquibase.test-rollback-on-update:true")
.run((context) -> {
SpringLiquibase liquibase = context.getBean(SpringLiquibase.class);
assertThat(liquibase.isTestRollbackOnUpdate());
});
}
@Test @Test
public void liquibaseDataSource() { public void liquibaseDataSource() {
this.contextRunner.withUserConfiguration(LiquibaseDataSourceConfiguration.class, this.contextRunner.withUserConfiguration(LiquibaseDataSourceConfiguration.class,
......
...@@ -567,6 +567,7 @@ content into your application. Rather, pick only the properties that you need. ...@@ -567,6 +567,7 @@ content into your application. Rather, pick only the properties that you need.
spring.liquibase.parameters.*= # Change log parameters. spring.liquibase.parameters.*= # Change log parameters.
spring.liquibase.password= # Login password of the database to migrate. spring.liquibase.password= # Login password of the database to migrate.
spring.liquibase.rollback-file= # File to which rollback SQL is written when an update is performed. spring.liquibase.rollback-file= # File to which rollback SQL is written when an update is performed.
spring.liquibase.test-rollback-on-update=false # Whether rollback should be tested before update is performed.
spring.liquibase.url= # JDBC URL of the database to migrate. If not set, the primary configured data source is used. spring.liquibase.url= # JDBC URL of the database to migrate. If not set, the primary configured data source is used.
spring.liquibase.user= # Login user of the database to migrate. spring.liquibase.user= # Login user of the database to migrate.
......
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