diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/liquibase/LiquibaseEndpointTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/liquibase/LiquibaseEndpointTests.java index e0cee4c0fc..8e4b16f086 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/liquibase/LiquibaseEndpointTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/liquibase/LiquibaseEndpointTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -104,10 +104,10 @@ public class LiquibaseEndpointTests { .liquibaseBeans().getContexts().get(context.getId()).getLiquibaseBeans(); assertThat(liquibaseBeans.get("liquibase").getChangeSets()).hasSize(1); 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().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 @@ public class LiquibaseEndpointTests { private SpringLiquibase createSpringLiquibase(String changeLog, DataSource dataSource) { SpringLiquibase liquibase = new SpringLiquibase(); - liquibase.setChangeLog("classpath:db/changelog/" + changeLog); + liquibase.setChangeLog("classpath:/db/changelog/" + changeLog); liquibase.setShouldRun(true); liquibase.setDataSource(dataSource); return liquibase; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java index 7cce05c042..2fe7fdf4e9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (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. */ - 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. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 1792bc06ce..eb1adaea34 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -964,7 +964,7 @@ "name": "liquibase.change-log", "type": "java.lang.String", "description": "Change log configuration path.", - "defaultValue": "classpath:db/changelog/db.changelog-master.yaml", + "defaultValue": "classpath:/db/changelog/db.changelog-master.yaml", "deprecation": { "replacement": "spring.liquibase.change-log", "level": "error" diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java index c5c356cda9..d3c819c39f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -92,7 +92,7 @@ public class LiquibaseAutoConfigurationTests { public void defaultSpringLiquibase() { this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) .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.getDefaultSchema()).isNull(); assertThat(liquibase.isDropFirst()).isFalse(); @@ -102,26 +102,26 @@ public class LiquibaseAutoConfigurationTests { @Test public void changelogXml() { 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()) - .isEqualTo("classpath:db/changelog/db.changelog-override.xml"))); + .isEqualTo("classpath:/db/changelog/db.changelog-override.xml"))); } @Test public void changelogJson() { 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()) - .isEqualTo("classpath:db/changelog/db.changelog-override.json"))); + .isEqualTo("classpath:/db/changelog/db.changelog-override.json"))); } @Test public void changelogSql() { Assume.javaEight(); 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()) - .isEqualTo("classpath:db/changelog/db.changelog-override.sql"))); + .isEqualTo("classpath:/db/changelog/db.changelog-override.sql"))); } @Test @@ -354,7 +354,7 @@ public class LiquibaseAutoConfigurationTests { @Bean SpringLiquibase springLiquibase(DataSource dataSource) { 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.setDataSource(dataSource); return liquibase; diff --git a/spring-boot-samples/spring-boot-sample-liquibase/src/test/java/sample/liquibase/SampleLiquibaseApplicationTests.java b/spring-boot-samples/spring-boot-sample-liquibase/src/test/java/sample/liquibase/SampleLiquibaseApplicationTests.java index 5dcdb5e821..9997e53575 100644 --- a/spring-boot-samples/spring-boot-sample-liquibase/src/test/java/sample/liquibase/SampleLiquibaseApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-liquibase/src/test/java/sample/liquibase/SampleLiquibaseApplicationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,9 +61,9 @@ public class SampleLiquibaseApplicationTests { assertThat(output).contains("Successfully acquired change log lock") .contains("Creating database history " + "table with name: PUBLIC.DATABASECHANGELOG") .contains("Table person created") - .contains("ChangeSet classpath:db/" + "changelog/db.changelog-master.yaml::1::" + .contains("ChangeSet classpath:/db/" + "changelog/db.changelog-master.yaml::1::" + "marceloverdijk ran successfully") - .contains("New row inserted into person").contains("ChangeSet classpath:db/changelog/" + .contains("New row inserted into person").contains("ChangeSet classpath:/db/changelog/" + "db.changelog-master.yaml::2::" + "marceloverdijk ran successfully") .contains("Successfully released change log lock"); }