Skip to content

Commit f6f1a9f

Browse files
committed
Merge branch '3.3.x' into 3.4.x
Closes gh-44483
2 parents d03847c + 278c7a5 commit f6f1a9f

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java

-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ private void configureProperties(FluentConfiguration configuration, FlywayProper
305305
map.from(properties::getLoggers).to((loggers) -> configuration.loggers(loggers));
306306
map.from(properties::getCommunityDbSupportEnabled)
307307
.to((communityDbSupportEnabled) -> configuration.communityDBSupportEnabled(communityDbSupportEnabled));
308-
// Flyway Teams properties
309308
map.from(properties.getBatch()).to((batch) -> configuration.batch(batch));
310309
map.from(properties.getDryRunOutput()).to((dryRunOutput) -> configuration.dryRunOutput(dryRunOutput));
311310
map.from(properties.getErrorOverrides())

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java

+6-8
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public class FlywayProperties {
275275
private String[] loggers = { "slf4j" };
276276

277277
/**
278-
* Whether to batch SQL statements when executing them. Requires Flyway Teams.
278+
* Whether to batch SQL statements when executing them.
279279
*/
280280
private Boolean batch;
281281

@@ -292,12 +292,12 @@ public class FlywayProperties {
292292
private String[] errorOverrides;
293293

294294
/**
295-
* Whether to stream SQL migrations when executing them. Requires Flyway Teams.
295+
* Whether to stream SQL migrations when executing them.
296296
*/
297297
private Boolean stream;
298298

299299
/**
300-
* Properties to pass to the JDBC driver. Requires Flyway Teams.
300+
* Properties to pass to the JDBC driver.
301301
*/
302302
private Map<String, String> jdbcProperties = new HashMap<>();
303303

@@ -308,25 +308,23 @@ public class FlywayProperties {
308308

309309
/**
310310
* Whether Flyway should output a table with the results of queries when executing
311-
* migrations. Requires Flyway Teams.
311+
* migrations.
312312
*/
313313
private Boolean outputQueryResults;
314314

315315
/**
316316
* Whether Flyway should skip executing the contents of the migrations and only update
317-
* the schema history table. Requires Flyway teams.
317+
* the schema history table.
318318
*/
319319
private Boolean skipExecutingMigrations;
320320

321321
/**
322322
* List of patterns that identify migrations to ignore when performing validation.
323-
* Requires Flyway Teams.
324323
*/
325324
private List<String> ignoreMigrationPatterns;
326325

327326
/**
328-
* Whether to attempt to automatically detect SQL migration file encoding. Requires
329-
* Flyway Teams.
327+
* Whether to attempt to automatically detect SQL migration file encoding.
330328
*/
331329
private Boolean detectEncoding;
332330

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java

+17
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.flywaydb.core.api.callback.Event;
3434
import org.flywaydb.core.api.configuration.FluentConfiguration;
3535
import org.flywaydb.core.api.migration.JavaMigration;
36+
import org.flywaydb.core.api.pattern.ValidatePattern;
3637
import org.flywaydb.core.internal.license.FlywayEditionUpgradeRequiredException;
3738
import org.flywaydb.database.oracle.OracleConfigurationExtension;
3839
import org.flywaydb.database.postgresql.PostgreSQLConfigurationExtension;
@@ -916,6 +917,22 @@ void shouldRegisterResourceHints() {
916917
assertThat(RuntimeHintsPredicates.resource().forResource("db/migration/V1__init.sql")).accepts(runtimeHints);
917918
}
918919

920+
@Test
921+
void detectEncodingCorrectlyMapped() {
922+
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
923+
.withPropertyValues("spring.flyway.detect-encoding=true")
924+
.run((context) -> assertThat(context.getBean(Flyway.class).getConfiguration().isDetectEncoding())
925+
.isEqualTo(true));
926+
}
927+
928+
@Test
929+
void ignoreMigrationPatternsCorrectlyMapped() {
930+
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
931+
.withPropertyValues("spring.flyway.ignore-migration-patterns=*:missing")
932+
.run((context) -> assertThat(context.getBean(Flyway.class).getConfiguration().getIgnoreMigrationPatterns())
933+
.containsExactly(ValidatePattern.fromPattern("*:missing")));
934+
}
935+
919936
private ContextConsumer<AssertableApplicationContext> validateFlywayTeamsPropertyOnly(String propertyName) {
920937
return (context) -> {
921938
assertThat(context).hasFailed();

0 commit comments

Comments
 (0)