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
fc09a239
Commit
fc09a239
authored
Dec 13, 2016
by
Eddú Meléndez
Committed by
Stephane Nicoll
Dec 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing actuator metadata
Health metadata for cassandra and couchbase is added. See gh-7632
parent
2a5e22fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
0 deletions
+42
-0
additional-spring-configuration-metadata.json
...es/META-INF/additional-spring-configuration-metadata.json
+12
-0
HealthIndicatorAutoConfigurationTests.java
.../autoconfigure/HealthIndicatorAutoConfigurationTests.java
+30
-0
No files found.
spring-boot-actuator/src/main/resources/META-INF/additional-spring-configuration-metadata.json
View file @
fc09a239
...
...
@@ -85,6 +85,18 @@
"type"
:
"java.util.Map<java.lang.String,java.lang.Object>"
,
"description"
:
"Arbitrary properties to add to the info endpoint."
},
{
"name"
:
"management.health.cassandra.enabled"
,
"type"
:
"java.lang.Boolean"
,
"description"
:
"Enable cassandra health check."
,
"defaultValue"
:
true
},
{
"name"
:
"management.health.couchbase.enabled"
,
"type"
:
"java.lang.Boolean"
,
"description"
:
"Enable couchbase health check."
,
"defaultValue"
:
true
},
{
"name"
:
"management.health.db.enabled"
,
"type"
:
"java.lang.Boolean"
,
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfigurationTests.java
View file @
fc09a239
...
...
@@ -457,6 +457,21 @@ public class HealthIndicatorAutoConfigurationTests {
.
isEqualTo
(
CassandraHealthIndicator
.
class
);
}
@Test
public
void
notCassandraHealthIndicator
()
throws
Exception
{
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"management.health.diskspace.enabled:false"
,
"management.health.cassandra.enabled:false"
);
this
.
context
.
register
(
CassandraConfiguration
.
class
,
ManagementServerProperties
.
class
,
HealthIndicatorAutoConfiguration
.
class
);
this
.
context
.
refresh
();
Map
<
String
,
HealthIndicator
>
beans
=
this
.
context
.
getBeansOfType
(
HealthIndicator
.
class
);
assertThat
(
beans
).
hasSize
(
1
);
assertThat
(
beans
.
values
().
iterator
().
next
().
getClass
())
.
isEqualTo
(
ApplicationHealthIndicator
.
class
);
}
@Test
public
void
couchbaseHealthIndicator
()
throws
Exception
{
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
...
...
@@ -471,6 +486,21 @@ public class HealthIndicatorAutoConfigurationTests {
.
isEqualTo
(
CouchbaseHealthIndicator
.
class
);
}
@Test
public
void
notCouchbaseHealthIndicator
()
throws
Exception
{
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"management.health.diskspace.enabled:false"
,
"management.health.couchbase.enabled:false"
);
this
.
context
.
register
(
CouchbaseConfiguration
.
class
,
ManagementServerProperties
.
class
,
HealthIndicatorAutoConfiguration
.
class
);
this
.
context
.
refresh
();
Map
<
String
,
HealthIndicator
>
beans
=
this
.
context
.
getBeansOfType
(
HealthIndicator
.
class
);
assertThat
(
beans
.
size
()).
isEqualTo
(
1
);
assertThat
(
beans
.
values
().
iterator
().
next
().
getClass
())
.
isEqualTo
(
ApplicationHealthIndicator
.
class
);
}
@Configuration
@EnableConfigurationProperties
protected
static
class
DataSourceConfig
{
...
...
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