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
2ede9e63
Commit
2ede9e63
authored
Feb 14, 2020
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.1.x' into 2.2.x
Closes gh-20117
parents
06c85e96
32c1dd45
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
19 deletions
+19
-19
LiquibaseEndpointTests.java
...mework/boot/actuate/liquibase/LiquibaseEndpointTests.java
+4
-4
LiquibaseProperties.java
...ork/boot/autoconfigure/liquibase/LiquibaseProperties.java
+2
-2
additional-spring-configuration-metadata.json
...es/META-INF/additional-spring-configuration-metadata.json
+1
-1
LiquibaseAutoConfigurationTests.java
...oconfigure/liquibase/LiquibaseAutoConfigurationTests.java
+9
-9
SampleLiquibaseApplicationTests.java
.../smoketest/liquibase/SampleLiquibaseApplicationTests.java
+3
-3
No files found.
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/liquibase/LiquibaseEndpointTests.java
View file @
2ede9e63
/*
/*
* Copyright 2012-20
20
the original author or authors.
* Copyright 2012-20
19
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.
...
@@ -104,10 +104,10 @@ class LiquibaseEndpointTests {
...
@@ -104,10 +104,10 @@ class LiquibaseEndpointTests {
.
liquibaseBeans
().
getContexts
().
get
(
context
.
getId
()).
getLiquibaseBeans
();
.
liquibaseBeans
().
getContexts
().
get
(
context
.
getId
()).
getLiquibaseBeans
();
assertThat
(
liquibaseBeans
.
get
(
"liquibase"
).
getChangeSets
()).
hasSize
(
1
);
assertThat
(
liquibaseBeans
.
get
(
"liquibase"
).
getChangeSets
()).
hasSize
(
1
);
assertThat
(
liquibaseBeans
.
get
(
"liquibase"
).
getChangeSets
().
get
(
0
).
getChangeLog
())
assertThat
(
liquibaseBeans
.
get
(
"liquibase"
).
getChangeSets
().
get
(
0
).
getChangeLog
())
.
isEqualTo
(
"classpath:db/changelog/db.changelog-master.yaml"
);
.
isEqualTo
(
"classpath:
/
db/changelog/db.changelog-master.yaml"
);
assertThat
(
liquibaseBeans
.
get
(
"liquibaseBackup"
).
getChangeSets
()).
hasSize
(
1
);
assertThat
(
liquibaseBeans
.
get
(
"liquibaseBackup"
).
getChangeSets
()).
hasSize
(
1
);
assertThat
(
liquibaseBeans
.
get
(
"liquibaseBackup"
).
getChangeSets
().
get
(
0
).
getChangeLog
())
assertThat
(
liquibaseBeans
.
get
(
"liquibaseBackup"
).
getChangeSets
().
get
(
0
).
getChangeLog
())
.
isEqualTo
(
"classpath:db/changelog/db.changelog-master-backup.yaml"
);
.
isEqualTo
(
"classpath:
/
db/changelog/db.changelog-master-backup.yaml"
);
});
});
}
}
...
@@ -157,7 +157,7 @@ class LiquibaseEndpointTests {
...
@@ -157,7 +157,7 @@ class LiquibaseEndpointTests {
private
SpringLiquibase
createSpringLiquibase
(
String
changeLog
,
DataSource
dataSource
)
{
private
SpringLiquibase
createSpringLiquibase
(
String
changeLog
,
DataSource
dataSource
)
{
SpringLiquibase
liquibase
=
new
SpringLiquibase
();
SpringLiquibase
liquibase
=
new
SpringLiquibase
();
liquibase
.
setChangeLog
(
"classpath:db/changelog/"
+
changeLog
);
liquibase
.
setChangeLog
(
"classpath:
/
db/changelog/"
+
changeLog
);
liquibase
.
setShouldRun
(
true
);
liquibase
.
setShouldRun
(
true
);
liquibase
.
setDataSource
(
dataSource
);
liquibase
.
setDataSource
(
dataSource
);
return
liquibase
;
return
liquibase
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java
View file @
2ede9e63
/*
/*
* Copyright 2012-20
20
the original author or authors.
* Copyright 2012-20
19
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.
...
@@ -36,7 +36,7 @@ public class LiquibaseProperties {
...
@@ -36,7 +36,7 @@ public class LiquibaseProperties {
/**
/**
* Change log configuration path.
* Change log configuration path.
*/
*/
private
String
changeLog
=
"classpath:db/changelog/db.changelog-master.yaml"
;
private
String
changeLog
=
"classpath:
/
db/changelog/db.changelog-master.yaml"
;
/**
/**
* Comma-separated list of runtime contexts to use.
* Comma-separated list of runtime contexts to use.
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json
View file @
2ede9e63
...
@@ -1043,7 +1043,7 @@
...
@@ -1043,7 +1043,7 @@
"name"
:
"liquibase.change-log"
,
"name"
:
"liquibase.change-log"
,
"type"
:
"java.lang.String"
,
"type"
:
"java.lang.String"
,
"description"
:
"Change log configuration path."
,
"description"
:
"Change log configuration path."
,
"defaultValue"
:
"classpath:db/changelog/db.changelog-master.yaml"
,
"defaultValue"
:
"classpath:
/
db/changelog/db.changelog-master.yaml"
,
"deprecation"
:
{
"deprecation"
:
{
"replacement"
:
"spring.liquibase.change-log"
,
"replacement"
:
"spring.liquibase.change-log"
,
"level"
:
"error"
"level"
:
"error"
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java
View file @
2ede9e63
/*
/*
* Copyright 2012-20
20
the original author or authors.
* Copyright 2012-20
19
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.
...
@@ -102,7 +102,7 @@ class LiquibaseAutoConfigurationTests {
...
@@ -102,7 +102,7 @@ class LiquibaseAutoConfigurationTests {
void
defaultSpringLiquibase
()
{
void
defaultSpringLiquibase
()
{
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
.
run
(
assertLiquibase
((
liquibase
)
->
{
.
run
(
assertLiquibase
((
liquibase
)
->
{
assertThat
(
liquibase
.
getChangeLog
()).
isEqualTo
(
"classpath:db/changelog/db.changelog-master.yaml"
);
assertThat
(
liquibase
.
getChangeLog
()).
isEqualTo
(
"classpath:
/
db/changelog/db.changelog-master.yaml"
);
assertThat
(
liquibase
.
getContexts
()).
isNull
();
assertThat
(
liquibase
.
getContexts
()).
isNull
();
assertThat
(
liquibase
.
getDefaultSchema
()).
isNull
();
assertThat
(
liquibase
.
getDefaultSchema
()).
isNull
();
assertThat
(
liquibase
.
isDropFirst
()).
isFalse
();
assertThat
(
liquibase
.
isDropFirst
()).
isFalse
();
...
@@ -112,26 +112,26 @@ class LiquibaseAutoConfigurationTests {
...
@@ -112,26 +112,26 @@ class LiquibaseAutoConfigurationTests {
@Test
@Test
void
changelogXml
()
{
void
changelogXml
()
{
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
.
withPropertyValues
(
"spring.liquibase.change-log:classpath:db/changelog/db.changelog-override.xml"
)
.
withPropertyValues
(
"spring.liquibase.change-log:classpath:
/
db/changelog/db.changelog-override.xml"
)
.
run
(
assertLiquibase
((
liquibase
)
->
assertThat
(
liquibase
.
getChangeLog
())
.
run
(
assertLiquibase
((
liquibase
)
->
assertThat
(
liquibase
.
getChangeLog
())
.
isEqualTo
(
"classpath:db/changelog/db.changelog-override.xml"
)));
.
isEqualTo
(
"classpath:
/
db/changelog/db.changelog-override.xml"
)));
}
}
@Test
@Test
void
changelogJson
()
{
void
changelogJson
()
{
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
.
withPropertyValues
(
"spring.liquibase.change-log:classpath:db/changelog/db.changelog-override.json"
)
.
withPropertyValues
(
"spring.liquibase.change-log:classpath:
/
db/changelog/db.changelog-override.json"
)
.
run
(
assertLiquibase
((
liquibase
)
->
assertThat
(
liquibase
.
getChangeLog
())
.
run
(
assertLiquibase
((
liquibase
)
->
assertThat
(
liquibase
.
getChangeLog
())
.
isEqualTo
(
"classpath:db/changelog/db.changelog-override.json"
)));
.
isEqualTo
(
"classpath:
/
db/changelog/db.changelog-override.json"
)));
}
}
@Test
@Test
@EnabledOnJre
(
JRE
.
JAVA_8
)
@EnabledOnJre
(
JRE
.
JAVA_8
)
void
changelogSql
()
{
void
changelogSql
()
{
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
.
withPropertyValues
(
"spring.liquibase.change-log:classpath:db/changelog/db.changelog-override.sql"
)
.
withPropertyValues
(
"spring.liquibase.change-log:classpath:
/
db/changelog/db.changelog-override.sql"
)
.
run
(
assertLiquibase
((
liquibase
)
->
assertThat
(
liquibase
.
getChangeLog
())
.
run
(
assertLiquibase
((
liquibase
)
->
assertThat
(
liquibase
.
getChangeLog
())
.
isEqualTo
(
"classpath:db/changelog/db.changelog-override.sql"
)));
.
isEqualTo
(
"classpath:
/
db/changelog/db.changelog-override.sql"
)));
}
}
@Test
@Test
...
@@ -374,7 +374,7 @@ class LiquibaseAutoConfigurationTests {
...
@@ -374,7 +374,7 @@ class LiquibaseAutoConfigurationTests {
@Bean
@Bean
SpringLiquibase
springLiquibase
(
DataSource
dataSource
)
{
SpringLiquibase
springLiquibase
(
DataSource
dataSource
)
{
SpringLiquibase
liquibase
=
new
SpringLiquibase
();
SpringLiquibase
liquibase
=
new
SpringLiquibase
();
liquibase
.
setChangeLog
(
"classpath:db/changelog/db.changelog-master.yaml"
);
liquibase
.
setChangeLog
(
"classpath:
/
db/changelog/db.changelog-master.yaml"
);
liquibase
.
setShouldRun
(
true
);
liquibase
.
setShouldRun
(
true
);
liquibase
.
setDataSource
(
dataSource
);
liquibase
.
setDataSource
(
dataSource
);
return
liquibase
;
return
liquibase
;
...
...
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-liquibase/src/test/java/smoketest/liquibase/SampleLiquibaseApplicationTests.java
View file @
2ede9e63
/*
/*
* Copyright 2012-20
20
the original author or authors.
* Copyright 2012-20
19
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.
...
@@ -59,10 +59,10 @@ class SampleLiquibaseApplicationTests {
...
@@ -59,10 +59,10 @@ class SampleLiquibaseApplicationTests {
assertThat
(
output
).
contains
(
"Successfully acquired change log lock"
)
assertThat
(
output
).
contains
(
"Successfully acquired change log lock"
)
.
contains
(
"Creating database history table with name: PUBLIC.DATABASECHANGELOG"
)
.
contains
(
"Creating database history table with name: PUBLIC.DATABASECHANGELOG"
)
.
contains
(
"Table person created"
)
.
contains
(
"Table person created"
)
.
contains
(
"ChangeSet classpath:db/changelog/db.changelog-master.yaml::1::"
.
contains
(
"ChangeSet classpath:
/
db/changelog/db.changelog-master.yaml::1::"
+
"marceloverdijk ran successfully"
)
+
"marceloverdijk ran successfully"
)
.
contains
(
"New row inserted into person"
)
.
contains
(
"New row inserted into person"
)
.
contains
(
"ChangeSet classpath:db/changelog/"
.
contains
(
"ChangeSet classpath:
/
db/changelog/"
+
"db.changelog-master.yaml::2::marceloverdijk ran successfully"
)
+
"db.changelog-master.yaml::2::marceloverdijk ran successfully"
)
.
contains
(
"Successfully released change log lock"
);
.
contains
(
"Successfully released change log lock"
);
}
}
...
...
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