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
5dc2339e
Commit
5dc2339e
authored
Jun 17, 2019
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Consider properties from @AutoConfigureTestDatabase"
See gh-16814
parent
92256c80
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
FlywayAutoConfigurationTests.java
...ot/autoconfigure/flyway/FlywayAutoConfigurationTests.java
+7
-9
checkstyle-suppressions.xml
src/checkstyle/checkstyle-suppressions.xml
+0
-1
No files found.
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java
View file @
5dc2339e
...
@@ -30,7 +30,6 @@ import org.flywaydb.core.api.callback.Callback;
...
@@ -30,7 +30,6 @@ import org.flywaydb.core.api.callback.Callback;
import
org.flywaydb.core.api.callback.Context
;
import
org.flywaydb.core.api.callback.Context
;
import
org.flywaydb.core.api.callback.Event
;
import
org.flywaydb.core.api.callback.Event
;
import
org.flywaydb.core.api.callback.FlywayCallback
;
import
org.flywaydb.core.api.callback.FlywayCallback
;
import
org.flywaydb.core.internal.jdbc.DriverDataSource
;
import
org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform
;
import
org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.mockito.InOrder
;
import
org.mockito.InOrder
;
...
@@ -105,11 +104,10 @@ public class FlywayAutoConfigurationTests {
...
@@ -105,11 +104,10 @@ public class FlywayAutoConfigurationTests {
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
.
withPropertyValues
(
"spring.flyway.url:jdbc:hsqldb:mem:flywaytest"
).
run
((
context
)
->
{
.
withPropertyValues
(
"spring.flyway.url:jdbc:hsqldb:mem:flywaytest"
).
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
Flyway
.
class
);
assertThat
(
context
).
hasSingleBean
(
Flyway
.
class
);
assertThat
(
context
.
getBean
(
Flyway
.
class
).
getDataSource
()).
isNotNull
();
DataSource
dataSource
=
context
.
getBean
(
Flyway
.
class
).
getDataSource
();
assertThat
(((
DriverDataSource
)
context
.
getBean
(
Flyway
.
class
).
getDataSource
()).
getUser
())
assertThat
(
dataSource
).
isNotNull
();
.
isEqualTo
(
"sa"
);
assertThat
(
dataSource
).
hasFieldOrPropertyWithValue
(
"user"
,
"sa"
);
assertThat
(((
DriverDataSource
)
context
.
getBean
(
Flyway
.
class
).
getDataSource
()).
getPassword
())
assertThat
(
dataSource
).
hasFieldOrPropertyWithValue
(
"password"
,
""
);
.
isEqualTo
(
""
);
});
});
}
}
...
@@ -118,9 +116,9 @@ public class FlywayAutoConfigurationTests {
...
@@ -118,9 +116,9 @@ public class FlywayAutoConfigurationTests {
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
.
withPropertyValues
(
"spring.flyway.user:sa"
).
run
((
context
)
->
{
.
withPropertyValues
(
"spring.flyway.user:sa"
).
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
Flyway
.
class
);
assertThat
(
context
).
hasSingleBean
(
Flyway
.
class
);
assertThat
(
context
.
getBean
(
Flyway
.
class
).
getDataSource
()).
isNotNull
();
DataSource
dataSource
=
context
.
getBean
(
Flyway
.
class
).
getDataSource
();
assertThat
(
((
DriverDataSource
)
context
.
getBean
(
Flyway
.
class
).
getDataSource
()).
getUrl
())
assertThat
(
dataSource
).
isNotNull
();
.
startsWith
(
"jdbc:h2:mem:"
);
assertThat
(
dataSource
).
extracting
(
"url"
).
hasSize
(
1
).
first
().
asString
()
.
startsWith
(
"jdbc:h2:mem:"
);
});
});
}
}
...
...
src/checkstyle/checkstyle-suppressions.xml
View file @
5dc2339e
...
@@ -35,5 +35,4 @@
...
@@ -35,5 +35,4 @@
<suppress
files=
"LogbackMetricsAutoConfiguration\.java"
checks=
"IllegalImport"
/>
<suppress
files=
"LogbackMetricsAutoConfiguration\.java"
checks=
"IllegalImport"
/>
<suppress
files=
"RemoteUrlPropertyExtractorTests\.java"
checks=
"IllegalImport"
/>
<suppress
files=
"RemoteUrlPropertyExtractorTests\.java"
checks=
"IllegalImport"
/>
<suppress
files=
"SampleLogbackApplication\.java"
checks=
"IllegalImport"
/>
<suppress
files=
"SampleLogbackApplication\.java"
checks=
"IllegalImport"
/>
<suppress
files=
"FlywayAutoConfigurationTests\.java"
checks=
"IllegalImport"
/>
</suppressions>
</suppressions>
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