Skip to content

Commit

Permalink
Merge branch '1.5.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll committed Dec 14, 2016
2 parents 5b636a0 + 703ed90 commit a86678c
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 15 deletions.
10 changes: 5 additions & 5 deletions spring-boot-actuator-docs/src/main/asciidoc/loggers.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This endpoint allows you to view and modify the log levels for the loggers in your
application. It builds on top of the `LoggingSystem` abstraction and supports the same
logging frameworks. The logging levels are defined by the `LogLevel` enumeration and
consists of the following values (although not all logging systems support the full set):
consist of the following values (although not all logging systems support the full set):

* `TRACE`
* `DEBUG`
Expand All @@ -25,7 +25,7 @@ configuration defined.
Example curl request:
include::{generated}/loggers/curl-request.adoc[]

Example HTTP request: [small]##link:../health[icon:external-link[role="silver"]]##
Example HTTP request: [small]##link:../loggers[icon:external-link[role="silver"]]##
include::{generated}/loggers/http-request.adoc[]

Example HTTP response:
Expand All @@ -37,7 +37,7 @@ include::{generated}/loggers/http-response.adoc[]
Example curl request:
include::{generated}/single-logger/curl-request.adoc[]

Example HTTP request: [small]##link:../health[icon:external-link[role="silver"]]##
Example HTTP request: [small]##link:../loggers[icon:external-link[role="silver"]]##
include::{generated}/single-logger/http-request.adoc[]

Example HTTP response:
Expand All @@ -49,12 +49,12 @@ include::{generated}/single-logger/http-response.adoc[]
Setting the `configuredLevel` of a logger requires `POSTing` a partial payload to the
resource. The `configuredLevel` property must contain a string representation of the
enumeration described above. `null` indicates that the log level should be unset,
allowing it to inherit configuration from it's parent.
allowing it to inherit configuration from its parent.

Example curl request:
include::{generated}/set-logger/curl-request.adoc[]

Example HTTP request: [small]##link:../health[icon:external-link[role="silver"]]##
Example HTTP request: [small]##link:../loggers[icon:external-link[role="silver"]]##
include::{generated}/set-logger/http-request.adoc[]

Example HTTP response:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public EndpointHandlerMappingCustomizer mappingCustomizer() {

@Override
public void customize(EndpointHandlerMapping mapping) {
mapping.setInterceptors(new Object[] { interceptor() });
mapping.setInterceptors(interceptor());
}

};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ public EndpointHandlerMappingCustomizer mappingCustomizer() {

@Override
public void customize(EndpointHandlerMapping mapping) {
mapping.setInterceptors(new Object[] { interceptor() });
mapping.setInterceptors(interceptor());
}

};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,21 @@ public void cassandraHealthIndicator() throws Exception {
.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,
Expand All @@ -471,6 +486,21 @@ public void couchbaseHealthIndicator() throws Exception {
.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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public void recordsHttpInteractionsWithRegexTemplateVariable() throws Exception
}

@Test
public void recordsHttpInteractionsWithWilcardMapping() throws Exception {
public void recordsHttpInteractionsWithWildcardMapping() throws Exception {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
Config.class, MetricFilterAutoConfiguration.class);
Filter filter = context.getBean(Filter.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static class SpringBootHypermediaApplication {

public static void main(String[] args) {
SpringApplication.run(SpringBootHypermediaApplication.class,
new String[] { "--endpoints.hypermedia.enabled=false" });
"--endpoints.hypermedia.enabled=false");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1064,8 +1064,10 @@ content into your application; rather pick only the properties that you need.
management.ssl.trust-store-provider= # Provider for the trust store. Requires a custom management.port.
management.ssl.trust-store-type= # Type of the trust store. Requires a custom management.port.
# HEALTH INDICATORS (previously health.*)
# HEALTH INDICATORS
management.health.db.enabled=true # Enable database health check.
management.health.cassandra.enabled=true # Enable cassandra health check.
management.health.couchbase.enabled=true # Enable couchbase health check.
management.health.defaults.enabled=true # Enable default health indicators.
management.health.diskspace.enabled=true # Enable disk space health check.
management.health.diskspace.path= # Path used to compute the available disk space.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void stopApplication() {
@Test
public void addARequestMappingToAnExistingController() throws Exception {
TestRestTemplate template = new TestRestTemplate();
String urlBase = "http://localhost:" + awaitServerPort() + "/";
String urlBase = "http://localhost:" + awaitServerPort();
assertThat(template.getForObject(urlBase + "/one", String.class))
.isEqualTo("one");
assertThat(template.getForEntity(urlBase + "/two", String.class).getStatusCode())
Expand All @@ -111,7 +111,7 @@ public void removeARequestMappingFromAnExistingController() throws Exception {
@Test
public void createAController() throws Exception {
TestRestTemplate template = new TestRestTemplate();
String urlBase = "http://localhost:" + awaitServerPort() + "/";
String urlBase = "http://localhost:" + awaitServerPort();
assertThat(template.getForObject(urlBase + "/one", String.class))
.isEqualTo("one");
assertThat(template.getForEntity(urlBase + "/two", String.class).getStatusCode())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class JvmLauncher implements TestRule {

@Override
public Statement apply(Statement base, Description description) {
this.outputDirectory = new File("target/output/" + "/"
this.outputDirectory = new File("target/output/"
+ description.getMethodName().replaceAll("[^A-Za-z]+", ""));
this.outputDirectory.mkdirs();
return base;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public interface LibraryCallback {

/**
* Callback to for a single library backed by a {@link File}.
* Callback for a single library backed by a {@link File}.
* @param library the library
* @throws IOException if the operation fails
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public abstract class LoggingSystem {
public static final String NONE = "none";

/**
* The name used to for the root logger. LoggingSystem implementations should ensure
* The name used for the root logger. LoggingSystem implementations should ensure
* that this is the name used to represent the root logger, regardless of the
* underlying implementation.
*/
Expand Down

0 comments on commit a86678c

Please sign in to comment.