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
08279c88
Commit
08279c88
authored
May 14, 2018
by
Vladyslav Kiriushkin
Committed by
Stephane Nicoll
May 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add liquibase test rollback on update property
See gh-13159
parent
b839c98d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
LiquibaseAutoConfiguration.java
...t/autoconfigure/liquibase/LiquibaseAutoConfiguration.java
+1
-0
LiquibaseProperties.java
...ork/boot/autoconfigure/liquibase/LiquibaseProperties.java
+13
-1
LiquibaseAutoConfigurationTests.java
...oconfigure/liquibase/LiquibaseAutoConfigurationTests.java
+11
-0
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java
View file @
08279c88
...
@@ -129,6 +129,7 @@ public class LiquibaseAutoConfiguration {
...
@@ -129,6 +129,7 @@ public class LiquibaseAutoConfiguration {
liquibase
.
setLabels
(
this
.
properties
.
getLabels
());
liquibase
.
setLabels
(
this
.
properties
.
getLabels
());
liquibase
.
setChangeLogParameters
(
this
.
properties
.
getParameters
());
liquibase
.
setChangeLogParameters
(
this
.
properties
.
getParameters
());
liquibase
.
setRollbackFile
(
this
.
properties
.
getRollbackFile
());
liquibase
.
setRollbackFile
(
this
.
properties
.
getRollbackFile
());
liquibase
.
setTestRollbackOnUpdate
(
this
.
properties
.
isTestRollbackOnUpdate
());
return
liquibase
;
return
liquibase
;
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java
View file @
08279c88
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -94,6 +94,11 @@ public class LiquibaseProperties {
...
@@ -94,6 +94,11 @@ public class LiquibaseProperties {
*/
*/
private
File
rollbackFile
;
private
File
rollbackFile
;
/**
* Whether rollback should be tested before update is performed.
*/
private
boolean
testRollbackOnUpdate
;
public
String
getChangeLog
()
{
public
String
getChangeLog
()
{
return
this
.
changeLog
;
return
this
.
changeLog
;
}
}
...
@@ -191,4 +196,11 @@ public class LiquibaseProperties {
...
@@ -191,4 +196,11 @@ public class LiquibaseProperties {
this
.
rollbackFile
=
rollbackFile
;
this
.
rollbackFile
=
rollbackFile
;
}
}
public
boolean
isTestRollbackOnUpdate
()
{
return
this
.
testRollbackOnUpdate
;
}
public
void
setTestRollbackOnUpdate
(
boolean
testRollbackOnUpdate
)
{
this
.
testRollbackOnUpdate
=
testRollbackOnUpdate
;
}
}
}
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java
View file @
08279c88
...
@@ -238,6 +238,17 @@ public class LiquibaseAutoConfigurationTests {
...
@@ -238,6 +238,17 @@ public class LiquibaseAutoConfigurationTests {
});
});
}
}
@Test
public
void
testRollbackOnUpdate
()
throws
IOException
{
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
.
withPropertyValues
(
"spring.liquibase.test-rollback-on-update:true"
)
.
run
((
context
)
->
{
SpringLiquibase
liquibase
=
context
.
getBean
(
SpringLiquibase
.
class
);
assertThat
(
liquibase
.
isTestRollbackOnUpdate
());
});
}
@Test
@Test
public
void
liquibaseDataSource
()
{
public
void
liquibaseDataSource
()
{
this
.
contextRunner
.
withUserConfiguration
(
LiquibaseDataSourceConfiguration
.
class
,
this
.
contextRunner
.
withUserConfiguration
(
LiquibaseDataSourceConfiguration
.
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