Polish
This commit is contained in:
@@ -269,9 +269,10 @@ public class EndpointAutoConfigurationTests {
|
||||
if (location.exists()) {
|
||||
Properties gitInfoProperties = PropertiesLoaderUtils
|
||||
.loadProperties(location);
|
||||
PropertiesPropertySource gitPropertySource =
|
||||
new PropertiesPropertySource("git", gitInfoProperties);
|
||||
this.content = new PropertySourcesBinder(gitPropertySource).extractAll("git");
|
||||
PropertiesPropertySource gitPropertySource = new PropertiesPropertySource(
|
||||
"git", gitInfoProperties);
|
||||
this.content = new PropertySourcesBinder(gitPropertySource)
|
||||
.extractAll("git");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,8 +85,8 @@ public class InfoContributorAutoConfigurationTests {
|
||||
Map<String, InfoContributor> beans = this.context
|
||||
.getBeansOfType(InfoContributor.class);
|
||||
assertThat(beans).containsKeys("gitInfoContributor");
|
||||
Map<String, Object> content =
|
||||
invokeContributor(this.context.getBean("gitInfoContributor", InfoContributor.class));
|
||||
Map<String, Object> content = invokeContributor(
|
||||
this.context.getBean("gitInfoContributor", InfoContributor.class));
|
||||
Object git = content.get("git");
|
||||
assertThat(git).isInstanceOf(Map.class);
|
||||
Map<String, Object> gitInfo = (Map<String, Object>) git;
|
||||
@@ -97,8 +97,8 @@ public class InfoContributorAutoConfigurationTests {
|
||||
@Test
|
||||
public void gitPropertiesFullMode() {
|
||||
load(GitPropertiesConfiguration.class, "management.info.git.mode=full");
|
||||
Map<String, Object> content =
|
||||
invokeContributor(this.context.getBean("gitInfoContributor", InfoContributor.class));
|
||||
Map<String, Object> content = invokeContributor(
|
||||
this.context.getBean("gitInfoContributor", InfoContributor.class));
|
||||
Object git = content.get("git");
|
||||
assertThat(git).isInstanceOf(Map.class);
|
||||
Map<String, Object> gitInfo = (Map<String, Object>) git;
|
||||
@@ -120,8 +120,8 @@ public class InfoContributorAutoConfigurationTests {
|
||||
Map<String, InfoContributor> beans = this.context
|
||||
.getBeansOfType(InfoContributor.class);
|
||||
assertThat(beans).containsKeys("buildInfoContributor");
|
||||
Map<String, Object> content =
|
||||
invokeContributor(this.context.getBean("buildInfoContributor", InfoContributor.class));
|
||||
Map<String, Object> content = invokeContributor(
|
||||
this.context.getBean("buildInfoContributor", InfoContributor.class));
|
||||
Object build = content.get("build");
|
||||
assertThat(build).isInstanceOf(Map.class);
|
||||
Map<String, Object> gitInfo = (Map<String, Object>) build;
|
||||
@@ -132,8 +132,8 @@ public class InfoContributorAutoConfigurationTests {
|
||||
@Test
|
||||
public void buildPropertiesFullMode() {
|
||||
load(BuildPropertiesConfiguration.class, "management.info.build.mode=full");
|
||||
Map<String, Object> content =
|
||||
invokeContributor(this.context.getBean("buildInfoContributor", InfoContributor.class));
|
||||
Map<String, Object> content = invokeContributor(
|
||||
this.context.getBean("buildInfoContributor", InfoContributor.class));
|
||||
Object build = content.get("build");
|
||||
assertThat(build).isInstanceOf(Map.class);
|
||||
Map<String, Object> gitInfo = (Map<String, Object>) build;
|
||||
|
||||
@@ -62,24 +62,24 @@ public class SpringApplicationHierarchyTests {
|
||||
|
||||
@EnableAutoConfiguration(exclude = { ElasticsearchDataAutoConfiguration.class,
|
||||
ElasticsearchRepositoriesAutoConfiguration.class,
|
||||
CassandraAutoConfiguration.class,
|
||||
CassandraDataAutoConfiguration.class,
|
||||
CassandraAutoConfiguration.class, CassandraDataAutoConfiguration.class,
|
||||
RedisAutoConfiguration.class,
|
||||
RedisRepositoriesAutoConfiguration.class}, excludeName = {
|
||||
RedisRepositoriesAutoConfiguration.class }, excludeName = {
|
||||
"org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration" })
|
||||
public static class Child {
|
||||
|
||||
}
|
||||
|
||||
@EnableAutoConfiguration(exclude = { JolokiaAutoConfiguration.class,
|
||||
EndpointMBeanExportAutoConfiguration.class,
|
||||
ElasticsearchDataAutoConfiguration.class,
|
||||
ElasticsearchRepositoriesAutoConfiguration.class,
|
||||
CassandraAutoConfiguration.class,
|
||||
CassandraDataAutoConfiguration.class,
|
||||
CassandraAutoConfiguration.class, CassandraDataAutoConfiguration.class,
|
||||
RedisAutoConfiguration.class,
|
||||
RedisRepositoriesAutoConfiguration.class }, excludeName = {
|
||||
"org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration" })
|
||||
public static class Parent {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -39,7 +39,8 @@ public class GitInfoContributorTests {
|
||||
Properties properties = new Properties();
|
||||
properties.put("branch", "master");
|
||||
properties.put("commit.time", "2016-03-04T14:36:33+0100");
|
||||
GitInfoContributor contributor = new GitInfoContributor(new GitProperties(properties));
|
||||
GitInfoContributor contributor = new GitInfoContributor(
|
||||
new GitProperties(properties));
|
||||
Map<String, Object> content = contributor.generateContent();
|
||||
assertThat(content.get("commit")).isInstanceOf(Map.class);
|
||||
Map<String, Object> commit = (Map<String, Object>) content.get("commit");
|
||||
@@ -54,7 +55,8 @@ public class GitInfoContributorTests {
|
||||
Properties properties = new Properties();
|
||||
properties.put("branch", "master");
|
||||
properties.put("commit.id", "8e29a0b0d423d2665c6ee5171947c101a5c15681");
|
||||
GitInfoContributor contributor = new GitInfoContributor(new GitProperties(properties));
|
||||
GitInfoContributor contributor = new GitInfoContributor(
|
||||
new GitProperties(properties));
|
||||
Map<String, Object> content = contributor.generateContent();
|
||||
assertThat(content.get("commit")).isInstanceOf(Map.class);
|
||||
Map<String, Object> commit = (Map<String, Object>) content.get("commit");
|
||||
|
||||
Reference in New Issue
Block a user