parent
8159674484
commit
0f5eb465c9
|
|
@ -134,6 +134,12 @@ public class LiquibaseAutoConfiguration {
|
|||
if (properties.getUiService() != null) {
|
||||
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));
|
||||
return liquibase;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,6 +154,16 @@ public class LiquibaseProperties {
|
|||
*/
|
||||
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() {
|
||||
return this.changeLog;
|
||||
}
|
||||
|
|
@ -331,6 +341,22 @@ public class LiquibaseProperties {
|
|||
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
|
||||
* {@link UpdateSummaryEnum}. To maximize backwards compatibility, the Liquibase enum
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
* 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()));
|
||||
}
|
||||
|
||||
@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) {
|
||||
return (context) -> {
|
||||
assertThat(context).hasSingleBean(SpringLiquibase.class);
|
||||
|
|
|
|||
|
|
@ -1203,7 +1203,7 @@ bom {
|
|||
releaseNotes("https://github.com/lettuce-io/lettuce-core/releases/tag/{version}")
|
||||
}
|
||||
}
|
||||
library("Liquibase", "4.30.0") {
|
||||
library("Liquibase", "4.31.0") {
|
||||
group("org.liquibase") {
|
||||
modules = [
|
||||
"liquibase-cdi",
|
||||
|
|
|
|||
Loading…
Reference in New Issue