Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
58ebfdcb
Commit
58ebfdcb
authored
Jan 21, 2016
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish contribution
Closes gh-4973
parent
a749855c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
FlywayAutoConfiguration.java
...rk/boot/autoconfigure/flyway/FlywayAutoConfiguration.java
+3
-1
FlywayAutoConfigurationTests.java
...ot/autoconfigure/flyway/FlywayAutoConfigurationTests.java
+14
-1
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java
View file @
58ebfdcb
...
@@ -48,6 +48,7 @@ import org.springframework.util.Assert;
...
@@ -48,6 +48,7 @@ import org.springframework.util.Assert;
*
*
* @author Dave Syer
* @author Dave Syer
* @author Phillip Webb
* @author Phillip Webb
* @author Jacques-Etienne Beaudet
* @since 1.1.0
* @since 1.1.0
*/
*/
@Configuration
@Configuration
...
@@ -114,8 +115,9 @@ public class FlywayAutoConfiguration {
...
@@ -114,8 +115,9 @@ public class FlywayAutoConfiguration {
else
{
else
{
flyway
.
setDataSource
(
this
.
dataSource
);
flyway
.
setDataSource
(
this
.
dataSource
);
}
}
//
Explicitly set locations because the getter doesn't return a mutable value
//
TODO: remove this line once SPR-13749 is fixed
flyway
.
setLocations
(
this
.
properties
.
getLocations
().
toArray
(
new
String
[
0
]));
flyway
.
setLocations
(
this
.
properties
.
getLocations
().
toArray
(
new
String
[
0
]));
return
flyway
;
return
flyway
;
}
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java
View file @
58ebfdcb
...
@@ -104,7 +104,20 @@ public class FlywayAutoConfigurationTests {
...
@@ -104,7 +104,20 @@ public class FlywayAutoConfigurationTests {
@Test
@Test
public
void
overrideLocations
()
throws
Exception
{
public
void
overrideLocations
()
throws
Exception
{
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"flyway.locations[0]:classpath:db/changelog"
,
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"flyway.locations:classpath:db/changelog,classpath:db/migration"
);
registerAndRefresh
(
EmbeddedDataSourceConfiguration
.
class
,
FlywayAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
);
Flyway
flyway
=
this
.
context
.
getBean
(
Flyway
.
class
);
assertEquals
(
"[classpath:db/changelog, classpath:db/migration]"
,
Arrays
.
asList
(
flyway
.
getLocations
()).
toString
());
}
@Test
public
void
overrideLocationsList
()
throws
Exception
{
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"flyway.locations[0]:classpath:db/changelog"
,
"flyway.locations[1]:classpath:db/migration"
);
"flyway.locations[1]:classpath:db/migration"
);
registerAndRefresh
(
EmbeddedDataSourceConfiguration
.
class
,
registerAndRefresh
(
EmbeddedDataSourceConfiguration
.
class
,
FlywayAutoConfiguration
.
class
,
FlywayAutoConfiguration
.
class
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment