Move liquibase config properties to spring.liquibase

Closes gh-9897
This commit is contained in:
Madhura Bhave 2017-07-31 17:12:01 -07:00
parent f9e316306a
commit ea087b9bac
7 changed files with 29 additions and 29 deletions

View File

@ -50,7 +50,7 @@ public class SpringApplicationHierarchyTests {
@Test
public void testParent() {
SpringApplicationBuilder builder = new SpringApplicationBuilder(Child.class);
builder.properties("spring.flyway.enabled=false", "liquibase.enabled=false");
builder.properties("spring.flyway.enabled=false", "spring.liquibase.enabled=false");
builder.parent(Parent.class);
this.context = builder.run("--server.port=0");
}
@ -58,7 +58,7 @@ public class SpringApplicationHierarchyTests {
@Test
public void testChild() {
SpringApplicationBuilder builder = new SpringApplicationBuilder(Parent.class);
builder.properties("spring.flyway.enabled=false", "liquibase.enabled=false");
builder.properties("spring.flyway.enabled=false", "spring.liquibase.enabled=false");
builder.child(Child.class);
this.context = builder.run("--server.port=0");
}

View File

@ -51,7 +51,7 @@ public class LiquibaseEndpointTests extends AbstractEndpointTests<LiquibaseEndpo
this.context.close();
this.context = new AnnotationConfigApplicationContext();
TestPropertyValues
.of("liquibase.default-schema=CUSTOMSCHEMA",
.of("spring.liquibase.default-schema=CUSTOMSCHEMA",
"spring.datasource.generate-unique-name=true",
"spring.datasource.schema=classpath:/db/create-custom-schema.sql")
.applyTo(this.context);

View File

@ -60,7 +60,7 @@ import org.springframework.util.ReflectionUtils;
@Configuration
@ConditionalOnClass(SpringLiquibase.class)
@ConditionalOnBean(DataSource.class)
@ConditionalOnProperty(prefix = "liquibase", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "spring.liquibase", name = "enabled", matchIfMissing = true)
@AutoConfigureAfter({ DataSourceAutoConfiguration.class,
HibernateJpaAutoConfiguration.class })
public class LiquibaseAutoConfiguration {

View File

@ -30,7 +30,7 @@ import org.springframework.util.Assert;
* @author Marcel Overdijk
* @since 1.1.0
*/
@ConfigurationProperties(prefix = "liquibase", ignoreUnknownFields = false)
@ConfigurationProperties(prefix = "spring.liquibase", ignoreUnknownFields = false)
public class LiquibaseProperties {
/**

View File

@ -107,7 +107,7 @@ public class LiquibaseAutoConfigurationTests {
@Test
public void testXmlChangeLog() throws Exception {
TestPropertyValues
.of("liquibase.change-log:classpath:/db/changelog/db.changelog-override.xml")
.of("spring.liquibase.change-log:classpath:/db/changelog/db.changelog-override.xml")
.applyTo(this.context);
this.context.register(EmbeddedDataSourceConfiguration.class,
LiquibaseAutoConfiguration.class,
@ -121,7 +121,7 @@ public class LiquibaseAutoConfigurationTests {
@Test
public void testJsonChangeLog() throws Exception {
TestPropertyValues
.of("liquibase.change-log:classpath:/db/changelog/db.changelog-override.json")
.of("spring.liquibase.change-log:classpath:/db/changelog/db.changelog-override.json")
.applyTo(this.context);
this.context.register(EmbeddedDataSourceConfiguration.class,
LiquibaseAutoConfiguration.class,
@ -135,7 +135,7 @@ public class LiquibaseAutoConfigurationTests {
@Test
public void testSqlChangeLog() throws Exception {
TestPropertyValues
.of("liquibase.change-log:classpath:/db/changelog/db.changelog-override.sql")
.of("spring.liquibase.change-log:classpath:/db/changelog/db.changelog-override.sql")
.applyTo(this.context);
this.context.register(EmbeddedDataSourceConfiguration.class,
LiquibaseAutoConfiguration.class,
@ -148,7 +148,7 @@ public class LiquibaseAutoConfigurationTests {
@Test
public void testOverrideContexts() throws Exception {
TestPropertyValues.of("liquibase.contexts:test, production")
TestPropertyValues.of("spring.liquibase.contexts:test, production")
.applyTo(this.context);
this.context.register(EmbeddedDataSourceConfiguration.class,
LiquibaseAutoConfiguration.class,
@ -160,7 +160,7 @@ public class LiquibaseAutoConfigurationTests {
@Test
public void testOverrideDefaultSchema() throws Exception {
TestPropertyValues.of("liquibase.default-schema:public").applyTo(this.context);
TestPropertyValues.of("spring.liquibase.default-schema:public").applyTo(this.context);
this.context.register(EmbeddedDataSourceConfiguration.class,
LiquibaseAutoConfiguration.class,
PropertyPlaceholderAutoConfiguration.class);
@ -171,7 +171,7 @@ public class LiquibaseAutoConfigurationTests {
@Test
public void testOverrideDropFirst() throws Exception {
TestPropertyValues.of("liquibase.drop-first:true").applyTo(this.context);
TestPropertyValues.of("spring.liquibase.drop-first:true").applyTo(this.context);
this.context.register(EmbeddedDataSourceConfiguration.class,
LiquibaseAutoConfiguration.class,
PropertyPlaceholderAutoConfiguration.class);
@ -183,7 +183,7 @@ public class LiquibaseAutoConfigurationTests {
@Test
public void testOverrideDataSource() throws Exception {
TestPropertyValues
.of("liquibase.url:jdbc:hsqldb:mem:liquibase", "liquibase.user:sa")
.of("spring.liquibase.url:jdbc:hsqldb:mem:liquibase", "spring.liquibase.user:sa")
.applyTo(this.context);
this.context.register(EmbeddedDataSourceConfiguration.class,
LiquibaseAutoConfiguration.class,
@ -198,7 +198,7 @@ public class LiquibaseAutoConfigurationTests {
@Test(expected = BeanCreationException.class)
public void testChangeLogDoesNotExist() throws Exception {
TestPropertyValues.of("liquibase.change-log:classpath:/no-such-changelog.yaml")
TestPropertyValues.of("spring.liquibase.change-log:classpath:/no-such-changelog.yaml")
.applyTo(this.context);
this.context.register(EmbeddedDataSourceConfiguration.class,
LiquibaseAutoConfiguration.class,
@ -220,7 +220,7 @@ public class LiquibaseAutoConfigurationTests {
@Test
public void testOverrideLabels() throws Exception {
TestPropertyValues.of("liquibase.labels:test, production").applyTo(this.context);
TestPropertyValues.of("spring.liquibase.labels:test, production").applyTo(this.context);
this.context.register(EmbeddedDataSourceConfiguration.class,
LiquibaseAutoConfiguration.class,
PropertyPlaceholderAutoConfiguration.class);
@ -232,7 +232,7 @@ public class LiquibaseAutoConfigurationTests {
@Test
@SuppressWarnings("unchecked")
public void testOverrideParameters() throws Exception {
TestPropertyValues.of("liquibase.parameters.foo:bar").applyTo(this.context);
TestPropertyValues.of("spring.liquibase.parameters.foo:bar").applyTo(this.context);
this.context.register(EmbeddedDataSourceConfiguration.class,
LiquibaseAutoConfiguration.class,
PropertyPlaceholderAutoConfiguration.class);
@ -247,7 +247,7 @@ public class LiquibaseAutoConfigurationTests {
@Test
public void testRollbackFile() throws Exception {
File file = this.temp.newFile("rollback-file.sql");
TestPropertyValues.of("liquibase.rollbackFile:" + file.getAbsolutePath())
TestPropertyValues.of("spring.liquibase.rollbackFile:" + file.getAbsolutePath())
.applyTo(this.context);
this.context.register(EmbeddedDataSourceConfiguration.class,
LiquibaseAutoConfiguration.class,

View File

@ -113,7 +113,7 @@ public class HibernateJpaAutoConfigurationTests
public void testLiquibasePlusValidation() throws Exception {
load(new Class<?>[0], new Class<?>[] { LiquibaseAutoConfiguration.class },
"spring.datasource.initialize:false",
"liquibase.changeLog:classpath:db/changelog/db.changelog-city.yaml",
"spring.liquibase.changeLog:classpath:db/changelog/db.changelog-city.yaml",
"spring.jpa.hibernate.ddl-auto:validate");
}

View File

@ -551,18 +551,18 @@ content into your application; rather pick only the properties that you need.
spring.flyway.validate-on-migrate= #
# LIQUIBASE ({sc-spring-boot-autoconfigure}/liquibase/LiquibaseProperties.{sc-ext}[LiquibaseProperties])
liquibase.change-log=classpath:/db/changelog/db.changelog-master.yaml # Change log configuration path.
liquibase.check-change-log-location=true # Check the change log location exists.
liquibase.contexts= # Comma-separated list of runtime contexts to use.
liquibase.default-schema= # Default database schema.
liquibase.drop-first=false # Drop the database schema first.
liquibase.enabled=true # Enable liquibase support.
liquibase.labels= # Comma-separated list of runtime labels to use.
liquibase.parameters.*= # Change log parameters.
liquibase.password= # Login password of the database to migrate.
liquibase.rollback-file= # File to which rollback SQL will be written when an update is performed.
liquibase.url= # JDBC url of the database to migrate. If not set, the primary configured data source is used.
liquibase.user= # Login user of the database to migrate.
spring.liquibase.change-log=classpath:/db/changelog/db.changelog-master.yaml # Change log configuration path.
spring.liquibase.check-change-log-location=true # Check the change log location exists.
spring.liquibase.contexts= # Comma-separated list of runtime contexts to use.
spring.liquibase.default-schema= # Default database schema.
spring.liquibase.drop-first=false # Drop the database schema first.
spring.liquibase.enabled=true # Enable liquibase support.
spring.liquibase.labels= # Comma-separated list of runtime labels to use.
spring.liquibase.parameters.*= # Change log parameters.
spring.liquibase.password= # Login password of the database to migrate.
spring.liquibase.rollback-file= # File to which rollback SQL will be written when an 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.user= # Login user of the database to migrate.
# COUCHBASE ({sc-spring-boot-autoconfigure}/couchbase/CouchbaseProperties.{sc-ext}[CouchbaseProperties])
spring.couchbase.bootstrap-hosts= # Couchbase nodes (host or IP address) to bootstrap from.