commit
466c1ba251
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -104,10 +104,10 @@ class LiquibaseEndpointTests {
|
||||||
.liquibaseBeans().getContexts().get(context.getId()).getLiquibaseBeans();
|
.liquibaseBeans().getContexts().get(context.getId()).getLiquibaseBeans();
|
||||||
assertThat(liquibaseBeans.get("liquibase").getChangeSets()).hasSize(1);
|
assertThat(liquibaseBeans.get("liquibase").getChangeSets()).hasSize(1);
|
||||||
assertThat(liquibaseBeans.get("liquibase").getChangeSets().get(0).getChangeLog())
|
assertThat(liquibaseBeans.get("liquibase").getChangeSets().get(0).getChangeLog())
|
||||||
.isEqualTo("classpath:/db/changelog/db.changelog-master.yaml");
|
.isEqualTo("classpath:db/changelog/db.changelog-master.yaml");
|
||||||
assertThat(liquibaseBeans.get("liquibaseBackup").getChangeSets()).hasSize(1);
|
assertThat(liquibaseBeans.get("liquibaseBackup").getChangeSets()).hasSize(1);
|
||||||
assertThat(liquibaseBeans.get("liquibaseBackup").getChangeSets().get(0).getChangeLog())
|
assertThat(liquibaseBeans.get("liquibaseBackup").getChangeSets().get(0).getChangeLog())
|
||||||
.isEqualTo("classpath:/db/changelog/db.changelog-master-backup.yaml");
|
.isEqualTo("classpath:db/changelog/db.changelog-master-backup.yaml");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ class LiquibaseEndpointTests {
|
||||||
|
|
||||||
private SpringLiquibase createSpringLiquibase(String changeLog, DataSource dataSource) {
|
private SpringLiquibase createSpringLiquibase(String changeLog, DataSource dataSource) {
|
||||||
SpringLiquibase liquibase = new SpringLiquibase();
|
SpringLiquibase liquibase = new SpringLiquibase();
|
||||||
liquibase.setChangeLog("classpath:/db/changelog/" + changeLog);
|
liquibase.setChangeLog("classpath:db/changelog/" + changeLog);
|
||||||
liquibase.setShouldRun(true);
|
liquibase.setShouldRun(true);
|
||||||
liquibase.setDataSource(dataSource);
|
liquibase.setDataSource(dataSource);
|
||||||
return liquibase;
|
return liquibase;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -36,7 +36,7 @@ public class LiquibaseProperties {
|
||||||
/**
|
/**
|
||||||
* Change log configuration path.
|
* Change log configuration path.
|
||||||
*/
|
*/
|
||||||
private String changeLog = "classpath:/db/changelog/db.changelog-master.yaml";
|
private String changeLog = "classpath:db/changelog/db.changelog-master.yaml";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Comma-separated list of runtime contexts to use.
|
* Comma-separated list of runtime contexts to use.
|
||||||
|
|
|
@ -1094,7 +1094,7 @@
|
||||||
"name": "liquibase.change-log",
|
"name": "liquibase.change-log",
|
||||||
"type": "java.lang.String",
|
"type": "java.lang.String",
|
||||||
"description": "Change log configuration path.",
|
"description": "Change log configuration path.",
|
||||||
"defaultValue": "classpath:/db/changelog/db.changelog-master.yaml",
|
"defaultValue": "classpath:db/changelog/db.changelog-master.yaml",
|
||||||
"deprecation": {
|
"deprecation": {
|
||||||
"replacement": "spring.liquibase.change-log",
|
"replacement": "spring.liquibase.change-log",
|
||||||
"level": "error"
|
"level": "error"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -102,7 +102,7 @@ class LiquibaseAutoConfigurationTests {
|
||||||
void defaultSpringLiquibase() {
|
void defaultSpringLiquibase() {
|
||||||
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
||||||
.run(assertLiquibase((liquibase) -> {
|
.run(assertLiquibase((liquibase) -> {
|
||||||
assertThat(liquibase.getChangeLog()).isEqualTo("classpath:/db/changelog/db.changelog-master.yaml");
|
assertThat(liquibase.getChangeLog()).isEqualTo("classpath:db/changelog/db.changelog-master.yaml");
|
||||||
assertThat(liquibase.getContexts()).isNull();
|
assertThat(liquibase.getContexts()).isNull();
|
||||||
assertThat(liquibase.getDefaultSchema()).isNull();
|
assertThat(liquibase.getDefaultSchema()).isNull();
|
||||||
assertThat(liquibase.isDropFirst()).isFalse();
|
assertThat(liquibase.isDropFirst()).isFalse();
|
||||||
|
@ -112,26 +112,26 @@ class LiquibaseAutoConfigurationTests {
|
||||||
@Test
|
@Test
|
||||||
void changelogXml() {
|
void changelogXml() {
|
||||||
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
||||||
.withPropertyValues("spring.liquibase.change-log:classpath:/db/changelog/db.changelog-override.xml")
|
.withPropertyValues("spring.liquibase.change-log:classpath:db/changelog/db.changelog-override.xml")
|
||||||
.run(assertLiquibase((liquibase) -> assertThat(liquibase.getChangeLog())
|
.run(assertLiquibase((liquibase) -> assertThat(liquibase.getChangeLog())
|
||||||
.isEqualTo("classpath:/db/changelog/db.changelog-override.xml")));
|
.isEqualTo("classpath:db/changelog/db.changelog-override.xml")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void changelogJson() {
|
void changelogJson() {
|
||||||
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
||||||
.withPropertyValues("spring.liquibase.change-log:classpath:/db/changelog/db.changelog-override.json")
|
.withPropertyValues("spring.liquibase.change-log:classpath:db/changelog/db.changelog-override.json")
|
||||||
.run(assertLiquibase((liquibase) -> assertThat(liquibase.getChangeLog())
|
.run(assertLiquibase((liquibase) -> assertThat(liquibase.getChangeLog())
|
||||||
.isEqualTo("classpath:/db/changelog/db.changelog-override.json")));
|
.isEqualTo("classpath:db/changelog/db.changelog-override.json")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@EnabledOnJre(JRE.JAVA_8)
|
@EnabledOnJre(JRE.JAVA_8)
|
||||||
void changelogSql() {
|
void changelogSql() {
|
||||||
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
||||||
.withPropertyValues("spring.liquibase.change-log:classpath:/db/changelog/db.changelog-override.sql")
|
.withPropertyValues("spring.liquibase.change-log:classpath:db/changelog/db.changelog-override.sql")
|
||||||
.run(assertLiquibase((liquibase) -> assertThat(liquibase.getChangeLog())
|
.run(assertLiquibase((liquibase) -> assertThat(liquibase.getChangeLog())
|
||||||
.isEqualTo("classpath:/db/changelog/db.changelog-override.sql")));
|
.isEqualTo("classpath:db/changelog/db.changelog-override.sql")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -374,7 +374,7 @@ class LiquibaseAutoConfigurationTests {
|
||||||
@Bean
|
@Bean
|
||||||
SpringLiquibase springLiquibase(DataSource dataSource) {
|
SpringLiquibase springLiquibase(DataSource dataSource) {
|
||||||
SpringLiquibase liquibase = new SpringLiquibase();
|
SpringLiquibase liquibase = new SpringLiquibase();
|
||||||
liquibase.setChangeLog("classpath:/db/changelog/db.changelog-master.yaml");
|
liquibase.setChangeLog("classpath:db/changelog/db.changelog-master.yaml");
|
||||||
liquibase.setShouldRun(true);
|
liquibase.setShouldRun(true);
|
||||||
liquibase.setDataSource(dataSource);
|
liquibase.setDataSource(dataSource);
|
||||||
return liquibase;
|
return liquibase;
|
||||||
|
|
Loading…
Reference in New Issue