Commit 2577c671 authored by Stephane Nicoll's avatar Stephane Nicoll

Fix mapping of outputQueryResults property

Closes gh-23645
parent 98914b65
...@@ -233,6 +233,9 @@ public class FlywayAutoConfiguration { ...@@ -233,6 +233,9 @@ public class FlywayAutoConfiguration {
map.from(properties.getOracleKerberosConfigFile()).whenNonNull() map.from(properties.getOracleKerberosConfigFile()).whenNonNull()
.to((configFile) -> configuration.orackeKerberosConfigFile(configFile)); .to((configFile) -> configuration.orackeKerberosConfigFile(configFile));
// No method reference for compatibility with Flyway 6.x // No method reference for compatibility with Flyway 6.x
map.from(properties.getOutputQueryResults()).whenNonNull()
.to((outputQueryResults) -> configuration.outputQueryResults(outputQueryResults));
// No method reference for compatibility with Flyway 6.x
map.from(properties.getSkipExecutingMigrations()).whenNonNull() map.from(properties.getSkipExecutingMigrations()).whenNonNull()
.to((skipExecutingMigrations) -> configuration.skipExecutingMigrations(skipExecutingMigrations)); .to((skipExecutingMigrations) -> configuration.skipExecutingMigrations(skipExecutingMigrations));
} }
......
...@@ -315,7 +315,7 @@ public class FlywayProperties { ...@@ -315,7 +315,7 @@ public class FlywayProperties {
* Whether Flyway should output a table with the results of queries when executing * Whether Flyway should output a table with the results of queries when executing
* migrations. Requires Flyway Teams. * migrations. Requires Flyway Teams.
*/ */
private boolean outputQueryResults = true; private Boolean outputQueryResults;
/** /**
* Whether Flyway should skip executing the contents of the migrations and only update * Whether Flyway should skip executing the contents of the migrations and only update
...@@ -743,11 +743,11 @@ public class FlywayProperties { ...@@ -743,11 +743,11 @@ public class FlywayProperties {
this.oracleKerberosConfigFile = oracleKerberosConfigFile; this.oracleKerberosConfigFile = oracleKerberosConfigFile;
} }
public boolean isOutputQueryResults() { public Boolean getOutputQueryResults() {
return this.outputQueryResults; return this.outputQueryResults;
} }
public void setOutputQueryResults(boolean outputQueryResults) { public void setOutputQueryResults(Boolean outputQueryResults) {
this.outputQueryResults = outputQueryResults; this.outputQueryResults = outputQueryResults;
} }
......
...@@ -563,6 +563,17 @@ class FlywayAutoConfigurationTests { ...@@ -563,6 +563,17 @@ class FlywayAutoConfigurationTests {
}); });
} }
@Test
void outputQueryResultsIsCorrectlyMapped() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues("spring.flyway.output-query-results=false").run((context) -> {
assertThat(context).hasFailed();
Throwable failure = context.getStartupFailure();
assertThat(failure).hasRootCauseInstanceOf(FlywayTeamsUpgradeRequiredException.class);
assertThat(failure).hasMessageContaining(" outputQueryResults ");
});
}
@Test @Test
void skipExecutingMigrationsIsCorrectlyMapped() { void skipExecutingMigrationsIsCorrectlyMapped() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment