Fix hint to include all Liquibase resources in default location

See gh-34729
This commit is contained in:
Andrii Bohutskyi 2023-03-23 11:34:05 +02:00 committed by Stephane Nicoll
parent 308e52702d
commit 408d5246bc
2 changed files with 4 additions and 1 deletions

View File

@ -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/*");
}
}

View File

@ -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<AssertableApplicationContext> assertLiquibase(Consumer<SpringLiquibase> consumer) {