Upgrade to Liquibase 4.31.0

Closes gh-43896
This commit is contained in:
Andy Wilkinson
2025-01-21 12:23:32 +00:00
parent 8159674484
commit 0f5eb465c9
4 changed files with 52 additions and 2 deletions

View File

@@ -134,6 +134,12 @@ public class LiquibaseAutoConfiguration {
if (properties.getUiService() != null) { if (properties.getUiService() != null) {
liquibase.setUiService(UIServiceEnum.valueOf(properties.getUiService().name())); liquibase.setUiService(UIServiceEnum.valueOf(properties.getUiService().name()));
} }
if (properties.getAnalyticsEnabled() != null) {
liquibase.setAnalyticsEnabled(properties.getAnalyticsEnabled());
}
if (properties.getLicenseKey() != null) {
liquibase.setLicenseKey(properties.getLicenseKey());
}
customizers.orderedStream().forEach((customizer) -> customizer.customize(liquibase)); customizers.orderedStream().forEach((customizer) -> customizer.customize(liquibase));
return liquibase; return liquibase;
} }

View File

@@ -154,6 +154,16 @@ public class LiquibaseProperties {
*/ */
private UiService uiService; private UiService uiService;
/**
* Whether to send product usage data and analytics to Liquibase.
*/
private Boolean analyticsEnabled;
/**
* Liquibase Pro license key.
*/
private String licenseKey;
public String getChangeLog() { public String getChangeLog() {
return this.changeLog; return this.changeLog;
} }
@@ -331,6 +341,22 @@ public class LiquibaseProperties {
this.uiService = uiService; this.uiService = uiService;
} }
public Boolean getAnalyticsEnabled() {
return this.analyticsEnabled;
}
public void setAnalyticsEnabled(Boolean analyticsEnabled) {
this.analyticsEnabled = analyticsEnabled;
}
public String getLicenseKey() {
return this.licenseKey;
}
public void setLicenseKey(String licenseKey) {
this.licenseKey = licenseKey;
}
/** /**
* Enumeration of types of summary to show. Values are the same as those on * Enumeration of types of summary to show. Values are the same as those on
* {@link UpdateSummaryEnum}. To maximize backwards compatibility, the Liquibase enum * {@link UpdateSummaryEnum}. To maximize backwards compatibility, the Liquibase enum

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2024 the original author or authors. * Copyright 2012-2025 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.
@@ -541,6 +541,24 @@ class LiquibaseAutoConfigurationTests {
.run(assertLiquibase((liquibase) -> assertThat(liquibase.getCustomizer()).isNotNull())); .run(assertLiquibase((liquibase) -> assertThat(liquibase.getCustomizer()).isNotNull()));
} }
@Test
void whenAnalyticsEnabledIsFalseThenSpringLiquibaseHasAnalyticsDisabled() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues("spring.liquibase.analytics-enabled=false")
.run((context) -> assertThat(context.getBean(SpringLiquibase.class))
.extracting(SpringLiquibase::getAnalyticsEnabled)
.isEqualTo(Boolean.FALSE));
}
@Test
void whenLicenseKeyIsSetThenSpringLiquibaseHasLicenseKey() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues("spring.liquibase.license-key=a1b2c3d4")
.run((context) -> assertThat(context.getBean(SpringLiquibase.class))
.extracting(SpringLiquibase::getLicenseKey)
.isEqualTo("a1b2c3d4"));
}
private ContextConsumer<AssertableApplicationContext> assertLiquibase(Consumer<SpringLiquibase> consumer) { private ContextConsumer<AssertableApplicationContext> assertLiquibase(Consumer<SpringLiquibase> consumer) {
return (context) -> { return (context) -> {
assertThat(context).hasSingleBean(SpringLiquibase.class); assertThat(context).hasSingleBean(SpringLiquibase.class);

View File

@@ -1203,7 +1203,7 @@ bom {
releaseNotes("https://github.com/lettuce-io/lettuce-core/releases/tag/{version}") releaseNotes("https://github.com/lettuce-io/lettuce-core/releases/tag/{version}")
} }
} }
library("Liquibase", "4.30.0") { library("Liquibase", "4.31.0") {
group("org.liquibase") { group("org.liquibase") {
modules = [ modules = [
"liquibase-cdi", "liquibase-cdi",