File tree 1 file changed +17
-0
lines changed
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 33
33
import org .flywaydb .core .api .callback .Event ;
34
34
import org .flywaydb .core .api .configuration .FluentConfiguration ;
35
35
import org .flywaydb .core .api .migration .JavaMigration ;
36
+ import org .flywaydb .core .api .pattern .ValidatePattern ;
36
37
import org .flywaydb .core .internal .license .FlywayEditionUpgradeRequiredException ;
37
38
import org .flywaydb .database .oracle .OracleConfigurationExtension ;
38
39
import org .flywaydb .database .postgresql .PostgreSQLConfigurationExtension ;
@@ -916,6 +917,22 @@ void shouldRegisterResourceHints() {
916
917
assertThat (RuntimeHintsPredicates .resource ().forResource ("db/migration/V1__init.sql" )).accepts (runtimeHints );
917
918
}
918
919
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
+
919
936
private ContextConsumer <AssertableApplicationContext > validateFlywayTeamsPropertyOnly (String propertyName ) {
920
937
return (context ) -> {
921
938
assertThat (context ).hasFailed ();
You can’t perform that action at this time.
0 commit comments