From 408d5246bc807d15f6378442ca5794a11dd93165 Mon Sep 17 00:00:00 2001 From: Andrii Bohutskyi Date: Thu, 23 Mar 2023 11:34:05 +0200 Subject: [PATCH] Fix hint to include all Liquibase resources in default location See gh-34729 --- .../autoconfigure/liquibase/LiquibaseAutoConfiguration.java | 2 +- .../liquibase/LiquibaseAutoConfigurationTests.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java index c6b65c50e3..d7d7026f47 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java @@ -175,7 +175,7 @@ public class LiquibaseAutoConfiguration { @Override public void registerHints(RuntimeHints hints, ClassLoader classLoader) { - hints.resources().registerPattern("db/changelog/db.changelog-master.yaml"); + hints.resources().registerPattern("db/changelog/*"); } } 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 f61a139983..bcd2087848 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 @@ -423,8 +423,11 @@ class LiquibaseAutoConfigurationTests { void shouldRegisterHints() { RuntimeHints hints = new RuntimeHints(); new LiquibaseAutoConfigurationRuntimeHints().registerHints(hints, getClass().getClassLoader()); + assertThat(RuntimeHintsPredicates.resource().forResource("db/changelog/")).accepts(hints); assertThat(RuntimeHintsPredicates.resource().forResource("db/changelog/db.changelog-master.yaml")) .accepts(hints); + assertThat(RuntimeHintsPredicates.resource().forResource("db/changelog/tables/init.sql")) + .accepts(hints); } private ContextConsumer assertLiquibase(Consumer consumer) {