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
d9586d94
Commit
d9586d94
authored
Nov 08, 2018
by
Andre Restolho
Committed by
Stephane Nicoll
Dec 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change DataSourceHealthIndicator details from "hello" to "result"
Closes gh-15136
parent
84ace92a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
DataSourceHealthIndicator.java
...ramework/boot/actuate/jdbc/DataSourceHealthIndicator.java
+1
-1
DataSourceHealthIndicatorTests.java
...ork/boot/actuate/jdbc/DataSourceHealthIndicatorTests.java
+2
-2
No files found.
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/jdbc/DataSourceHealthIndicator.java
View file @
d9586d94
...
@@ -114,7 +114,7 @@ public class DataSourceHealthIndicator extends AbstractHealthIndicator
...
@@ -114,7 +114,7 @@ public class DataSourceHealthIndicator extends AbstractHealthIndicator
List
<
Object
>
results
=
this
.
jdbcTemplate
.
query
(
validationQuery
,
List
<
Object
>
results
=
this
.
jdbcTemplate
.
query
(
validationQuery
,
new
SingleColumnRowMapper
());
new
SingleColumnRowMapper
());
Object
result
=
DataAccessUtils
.
requiredSingleResult
(
results
);
Object
result
=
DataAccessUtils
.
requiredSingleResult
(
results
);
builder
.
withDetail
(
"
hello
"
,
result
);
builder
.
withDetail
(
"
result
"
,
result
);
}
}
}
}
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/jdbc/DataSourceHealthIndicatorTests.java
View file @
d9586d94
...
@@ -67,7 +67,7 @@ public class DataSourceHealthIndicatorTests {
...
@@ -67,7 +67,7 @@ public class DataSourceHealthIndicatorTests {
this
.
indicator
.
setDataSource
(
this
.
dataSource
);
this
.
indicator
.
setDataSource
(
this
.
dataSource
);
Health
health
=
this
.
indicator
.
health
();
Health
health
=
this
.
indicator
.
health
();
assertThat
(
health
.
getDetails
().
get
(
"database"
)).
isNotNull
();
assertThat
(
health
.
getDetails
().
get
(
"database"
)).
isNotNull
();
assertThat
(
health
.
getDetails
().
get
(
"
hello
"
)).
isNotNull
();
assertThat
(
health
.
getDetails
().
get
(
"
result
"
)).
isNotNull
();
}
}
@Test
@Test
...
@@ -80,7 +80,7 @@ public class DataSourceHealthIndicatorTests {
...
@@ -80,7 +80,7 @@ public class DataSourceHealthIndicatorTests {
System
.
err
.
println
(
health
);
System
.
err
.
println
(
health
);
assertThat
(
health
.
getDetails
().
get
(
"database"
)).
isNotNull
();
assertThat
(
health
.
getDetails
().
get
(
"database"
)).
isNotNull
();
assertThat
(
health
.
getStatus
()).
isEqualTo
(
Status
.
UP
);
assertThat
(
health
.
getStatus
()).
isEqualTo
(
Status
.
UP
);
assertThat
(
health
.
getDetails
().
get
(
"
hello
"
)).
isNotNull
();
assertThat
(
health
.
getDetails
().
get
(
"
result
"
)).
isNotNull
();
}
}
@Test
@Test
...
...
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