Polish contribution

`InfoProvider` is now `InfoContributor` and contributes to the `Info`
instance via a builder. The `Info` instance is immutable. Each
contributor can be disabled via the `management.info.<name>.enabled`
key or all can be disabled using `management.info.defaults.enabled` (this
is similar to what the health endpoint does).

By default, all keys from the environment starting with `info.` are
exposed. If a `git.properties` file is present in the classpath, the
content of `GitInfo` is exposed using the `git` key.

A `SimpleInfoContributor` and `AbstractEnvironmentInfoContributor` are
available for convenience. `InfoContributor` instances can be ordered
the usual way, with a default order provided by
`InfoProviderAutoConfiguration#DEFAULT_ORDER`.

Closes gh-3492
This commit is contained in:
Stephane Nicoll
2016-03-01 19:01:11 +01:00
parent 7618802838
commit 0490fbc7f8
30 changed files with 954 additions and 623 deletions

View File

@@ -45,6 +45,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* Basic integration tests for service demo application.
*
* @author Dave Syer
* @author Stephane Nicoll
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(SampleActuatorApplication.class)
@@ -145,6 +146,8 @@ public class SampleActuatorApplicationTests {
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody())
.contains("\"artifact\":\"spring-boot-sample-actuator\"");
assertThat(entity.getBody())
.contains("\"someKey\":\"someValue\"");
}
@Test