Skip to content

Commit 8f265f8

Browse files
committed
Polish "Fix @FlywayDataSource with multiple data sources"
See gh-20617
1 parent 2410d6b commit 8f265f8

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -523,19 +523,19 @@ DataSource flywayDataSource() {
523523
static class FlywayMultipleDataSourcesConfiguration {
524524

525525
@Bean
526-
DataSource mainDataSource() {
527-
return DataSourceBuilder.create().url("jdbc:hsqldb:mem:main").username("sa").build();
526+
DataSource firstDataSource() {
527+
return DataSourceBuilder.create().url("jdbc:hsqldb:mem:first").username("sa").build();
528528
}
529529

530530
@Bean
531-
DataSource secondlyDataSource() {
532-
return DataSourceBuilder.create().url("jdbc:hsqldb:mem:secondly").username("sa").build();
531+
DataSource secondDataSource() {
532+
return DataSourceBuilder.create().url("jdbc:hsqldb:mem:second").username("sa").build();
533533
}
534534

535535
@FlywayDataSource
536536
@Bean
537-
DataSource flywayDataSource(DataSource mainDataSource) {
538-
return mainDataSource;
537+
DataSource flywayDataSource() {
538+
return DataSourceBuilder.create().url("jdbc:hsqldb:mem:flywaytest").username("sa").build();
539539
}
540540

541541
}

0 commit comments

Comments
 (0)