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
c7eec5c4
Commit
c7eec5c4
authored
May 14, 2018
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Add liquibase test rollback on update property"
Closes gh-13159
parent
08279c88
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
11 deletions
+14
-11
LiquibaseProperties.java
...ork/boot/autoconfigure/liquibase/LiquibaseProperties.java
+1
-0
LiquibaseAutoConfigurationTests.java
...oconfigure/liquibase/LiquibaseAutoConfigurationTests.java
+12
-11
appendix-application-properties.adoc
...cs/src/main/asciidoc/appendix-application-properties.adoc
+1
-0
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java
View file @
c7eec5c4
...
@@ -203,4 +203,5 @@ public class LiquibaseProperties {
...
@@ -203,4 +203,5 @@ public class LiquibaseProperties {
public
void
setTestRollbackOnUpdate
(
boolean
testRollbackOnUpdate
)
{
public
void
setTestRollbackOnUpdate
(
boolean
testRollbackOnUpdate
)
{
this
.
testRollbackOnUpdate
=
testRollbackOnUpdate
;
this
.
testRollbackOnUpdate
=
testRollbackOnUpdate
;
}
}
}
}
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java
View file @
c7eec5c4
...
@@ -178,6 +178,18 @@ public class LiquibaseAutoConfigurationTests {
...
@@ -178,6 +178,18 @@ public class LiquibaseAutoConfigurationTests {
}));
}));
}
}
@Test
public
void
overrideTestRollbackOnUpdate
()
{
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
.
withPropertyValues
(
"spring.liquibase.test-rollback-on-update:true"
)
.
run
((
context
)
->
{
SpringLiquibase
liquibase
=
context
.
getBean
(
SpringLiquibase
.
class
);
assertThat
(
liquibase
.
isTestRollbackOnUpdate
()).
isTrue
();
});
}
@Test
@Test
public
void
changeLogDoesNotExist
()
{
public
void
changeLogDoesNotExist
()
{
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
...
@@ -238,17 +250,6 @@ public class LiquibaseAutoConfigurationTests {
...
@@ -238,17 +250,6 @@ 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
,
...
...
spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
View file @
c7eec5c4
...
@@ -567,6 +567,7 @@ content into your application. Rather, pick only the properties that you need.
...
@@ -567,6 +567,7 @@ content into your application. Rather, pick only the properties that you need.
spring.liquibase.parameters.*= # Change log parameters.
spring.liquibase.parameters.*= # Change log parameters.
spring.liquibase.password= # Login password of the database to migrate.
spring.liquibase.password= # Login password of the database to migrate.
spring.liquibase.rollback-file= # File to which rollback SQL is written when an update is performed.
spring.liquibase.rollback-file= # File to which rollback SQL is written when an update is performed.
spring.liquibase.test-rollback-on-update=false # Whether rollback should be tested before update is performed.
spring.liquibase.url= # JDBC URL of the database to migrate. If not set, the primary configured data source is used.
spring.liquibase.url= # JDBC URL of the database to migrate. If not set, the primary configured data source is used.
spring.liquibase.user= # Login user of the database to migrate.
spring.liquibase.user= # Login user of the database to migrate.
...
...
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