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
a9f6ae44
Commit
a9f6ae44
authored
Jul 12, 2016
by
Johnny Lim
Committed by
Stephane Nicoll
Jul 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
Closes gh-6374
parent
43afc149
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
15 additions
and
20 deletions
+15
-20
CompositeHealthIndicatorConfiguration.java
.../autoconfigure/CompositeHealthIndicatorConfiguration.java
+2
-2
ElasticsearchHealthIndicatorConfiguration.java
...oconfigure/ElasticsearchHealthIndicatorConfiguration.java
+2
-2
HealthIndicatorAutoConfiguration.java
...tuate/autoconfigure/HealthIndicatorAutoConfiguration.java
+1
-1
ElasticsearchHealthIndicatorProperties.java
...ctuate/health/ElasticsearchHealthIndicatorProperties.java
+1
-1
ElasticsearchJestHealthIndicator.java
...boot/actuate/health/ElasticsearchJestHealthIndicator.java
+3
-2
HealthIndicatorAutoConfigurationTests.java
.../autoconfigure/HealthIndicatorAutoConfigurationTests.java
+2
-2
ElasticsearchJestHealthIndicatorTests.java
...actuate/health/ElasticsearchJestHealthIndicatorTests.java
+3
-3
Neo4jDataAutoConfigurationTests.java
...configure/data/neo4j/Neo4jDataAutoConfigurationTests.java
+0
-5
Neo4jRepositoriesAutoConfigurationTests.java
...e/data/neo4j/Neo4jRepositoriesAutoConfigurationTests.java
+0
-1
SpringBootTestContextCustomizer.java
...rk/boot/test/context/SpringBootTestContextCustomizer.java
+1
-1
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CompositeHealthIndicatorConfiguration.java
View file @
a9f6ae44
...
...
@@ -28,8 +28,8 @@ import org.springframework.core.ResolvableType;
* Base class for configurations that can combine source beans using a
* {@link CompositeHealthIndicator}.
*
* @param <H>
T
he health indicator type
* @param <S>
T
he bean source type
* @param <H>
t
he health indicator type
* @param <S>
t
he bean source type
* @author Stephane Nicoll
* @since 1.4.0
*/
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ElasticsearchHealthIndicatorConfiguration.java
View file @
a9f6ae44
...
...
@@ -43,14 +43,14 @@ class ElasticsearchHealthIndicatorConfiguration {
@ConditionalOnBean
(
Client
.
class
)
@ConditionalOnEnabledHealthIndicator
(
"elasticsearch"
)
@EnableConfigurationProperties
(
ElasticsearchHealthIndicatorProperties
.
class
)
static
class
Elasticsearch
SpringData
HealthIndicatorConfiguration
extends
static
class
Elasticsearch
Client
HealthIndicatorConfiguration
extends
CompositeHealthIndicatorConfiguration
<
ElasticsearchHealthIndicator
,
Client
>
{
private
final
Map
<
String
,
Client
>
clients
;
private
final
ElasticsearchHealthIndicatorProperties
properties
;
Elasticsearch
SpringData
HealthIndicatorConfiguration
(
Map
<
String
,
Client
>
clients
,
Elasticsearch
Client
HealthIndicatorConfiguration
(
Map
<
String
,
Client
>
clients
,
ElasticsearchHealthIndicatorProperties
properties
)
{
this
.
clients
=
clients
;
this
.
properties
=
properties
;
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfiguration.java
View file @
a9f6ae44
...
...
@@ -98,7 +98,7 @@ import org.springframework.mail.javamail.JavaMailSenderImpl;
MongoDataAutoConfiguration
.
class
,
RabbitAutoConfiguration
.
class
,
RedisAutoConfiguration
.
class
,
SolrAutoConfiguration
.
class
})
@EnableConfigurationProperties
({
HealthIndicatorProperties
.
class
})
@Import
({
ElasticsearchHealthIndicatorConfiguration
.
Elasticsearch
SpringData
HealthIndicatorConfiguration
.
class
,
@Import
({
ElasticsearchHealthIndicatorConfiguration
.
Elasticsearch
Client
HealthIndicatorConfiguration
.
class
,
ElasticsearchHealthIndicatorConfiguration
.
ElasticsearchJestHealthIndicatorConfiguration
.
class
})
public
class
HealthIndicatorAutoConfiguration
{
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/ElasticsearchHealthIndicatorProperties.java
View file @
a9f6ae44
...
...
@@ -37,7 +37,7 @@ public class ElasticsearchHealthIndicatorProperties {
private
List
<
String
>
indices
=
new
ArrayList
<
String
>();
/**
* T
he t
ime, in milliseconds, to wait for a response from the cluster.
* Time, in milliseconds, to wait for a response from the cluster.
*/
private
long
responseTimeout
=
100L
;
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/ElasticsearchJestHealthIndicator.java
View file @
a9f6ae44
...
...
@@ -33,6 +33,8 @@ public class ElasticsearchJestHealthIndicator extends AbstractHealthIndicator {
private
final
JestClient
jestClient
;
private
final
JsonParser
jsonParser
=
new
JsonParser
();
public
ElasticsearchJestHealthIndicator
(
JestClient
jestClient
)
{
this
.
jestClient
=
jestClient
;
}
...
...
@@ -40,8 +42,7 @@ public class ElasticsearchJestHealthIndicator extends AbstractHealthIndicator {
@Override
protected
void
doHealthCheck
(
Health
.
Builder
builder
)
throws
Exception
{
JestResult
aliases
=
this
.
jestClient
.
execute
(
new
Stats
.
Builder
().
build
());
JsonParser
jsonParser
=
new
JsonParser
();
JsonElement
root
=
jsonParser
.
parse
(
aliases
.
getJsonString
());
JsonElement
root
=
this
.
jsonParser
.
parse
(
aliases
.
getJsonString
());
JsonObject
shards
=
root
.
getAsJsonObject
().
get
(
"_shards"
).
getAsJsonObject
();
int
failedShards
=
shards
.
get
(
"failed"
).
getAsInt
();
if
(
failedShards
!=
0
)
{
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfigurationTests.java
View file @
a9f6ae44
...
...
@@ -394,7 +394,7 @@ public class HealthIndicatorAutoConfigurationTests {
}
@Test
public
void
elastic
S
earchHealthIndicator
()
{
public
void
elastic
s
earchHealthIndicator
()
{
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"spring.data.elasticsearch.properties.path.home:target"
,
"management.health.diskspace.enabled:false"
);
...
...
@@ -411,7 +411,7 @@ public class HealthIndicatorAutoConfigurationTests {
}
@Test
public
void
elastic
S
earchJestHealthIndicator
()
{
public
void
elastic
s
earchJestHealthIndicator
()
{
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"management.health.diskspace.enabled:false"
);
this
.
context
.
register
(
JestClientConfiguration
.
class
,
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/ElasticsearchJestHealthIndicatorTests.java
View file @
a9f6ae44
...
...
@@ -46,7 +46,7 @@ public class ElasticsearchJestHealthIndicatorTests {
@SuppressWarnings
(
"unchecked"
)
@Test
public
void
elastic
S
earchIsUp
()
throws
IOException
{
public
void
elastic
s
earchIsUp
()
throws
IOException
{
given
(
this
.
jestClient
.
execute
(
any
(
Action
.
class
)))
.
willReturn
(
createJestResult
(
4
,
0
));
...
...
@@ -56,7 +56,7 @@ public class ElasticsearchJestHealthIndicatorTests {
@SuppressWarnings
(
"unchecked"
)
@Test
public
void
elastic
S
earchIsDown
()
throws
IOException
{
public
void
elastic
s
earchIsDown
()
throws
IOException
{
given
(
this
.
jestClient
.
execute
(
any
(
Action
.
class
))).
willThrow
(
new
CouldNotConnectException
(
"http://localhost:9200"
,
new
IOException
()));
Health
health
=
this
.
healthIndicator
.
health
();
...
...
@@ -65,7 +65,7 @@ public class ElasticsearchJestHealthIndicatorTests {
@SuppressWarnings
(
"unchecked"
)
@Test
public
void
elastic
S
earchIsOutOfService
()
throws
IOException
{
public
void
elastic
s
earchIsOutOfService
()
throws
IOException
{
given
(
this
.
jestClient
.
execute
(
any
(
Action
.
class
)))
.
willReturn
(
createJestResult
(
4
,
1
));
Health
health
=
this
.
healthIndicator
.
health
();
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jDataAutoConfigurationTests.java
View file @
a9f6ae44
...
...
@@ -18,9 +18,7 @@ package org.springframework.boot.autoconfigure.data.neo4j;
import
org.assertj.core.api.Assertions
;
import
org.junit.After
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.rules.ExpectedException
;
import
org.neo4j.ogm.drivers.http.driver.HttpDriver
;
import
org.neo4j.ogm.session.Session
;
import
org.neo4j.ogm.session.SessionFactory
;
...
...
@@ -48,9 +46,6 @@ import static org.mockito.Mockito.mock;
*/
public
class
Neo4jDataAutoConfigurationTests
{
@Rule
public
final
ExpectedException
thrown
=
ExpectedException
.
none
();
private
AnnotationConfigApplicationContext
context
;
@After
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jRepositoriesAutoConfigurationTests.java
View file @
a9f6ae44
...
...
@@ -86,7 +86,6 @@ public class Neo4jRepositoriesAutoConfigurationTests {
"spring.data.neo4j.uri=http://localhost:9797"
);
this
.
context
.
register
(
configurationClasses
);
this
.
context
.
register
(
Neo4jDataAutoConfiguration
.
class
,
Neo4jDataAutoConfiguration
.
class
,
Neo4jRepositoriesAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
);
this
.
context
.
refresh
();
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTestContextCustomizer.java
View file @
a9f6ae44
...
...
@@ -78,7 +78,7 @@ class SpringBootTestContextCustomizer implements ContextCustomizer {
}
/**
* {@link FactoryBean} used to create a configure a {@link TestRestTemplate}.
* {@link FactoryBean} used to create a
nd
configure a {@link TestRestTemplate}.
*/
public
static
class
TestRestTemplateFactory
implements
FactoryBean
<
TestRestTemplate
>,
ApplicationContextAware
{
...
...
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