Merge pull request #5648 from izeye/polish-20160411
* polish-20160411: Polish
This commit is contained in:
commit
f500d67eaa
|
@ -124,8 +124,8 @@ public class InfoContributorAutoConfigurationTests {
|
|||
this.context.getBean("buildInfoContributor", InfoContributor.class));
|
||||
Object build = content.get("build");
|
||||
assertThat(build).isInstanceOf(Map.class);
|
||||
Map<String, Object> gitInfo = (Map<String, Object>) build;
|
||||
assertThat(gitInfo).containsOnlyKeys("group", "artifact");
|
||||
Map<String, Object> buildInfo = (Map<String, Object>) build;
|
||||
assertThat(buildInfo).containsOnlyKeys("group", "artifact");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
@ -136,9 +136,9 @@ public class InfoContributorAutoConfigurationTests {
|
|||
this.context.getBean("buildInfoContributor", InfoContributor.class));
|
||||
Object build = content.get("build");
|
||||
assertThat(build).isInstanceOf(Map.class);
|
||||
Map<String, Object> gitInfo = (Map<String, Object>) build;
|
||||
assertThat(gitInfo).containsOnlyKeys("group", "artifact", "foo");
|
||||
assertThat(gitInfo.get("foo")).isEqualTo("bar");
|
||||
Map<String, Object> buildInfo = (Map<String, Object>) build;
|
||||
assertThat(buildInfo).containsOnlyKeys("group", "artifact", "foo");
|
||||
assertThat(buildInfo.get("foo")).isEqualTo("bar");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -977,7 +977,7 @@ content into your application; rather pick only the properties that you need.
|
|||
management.health.solr.enabled=true # Enable Solr health check.
|
||||
management.health.status.order=DOWN, OUT_OF_SERVICE, UNKNOWN, UP # Comma-separated list of health statuses in order of severity.
|
||||
|
||||
# INFO CONTRIBUTORS
|
||||
# INFO CONTRIBUTORS ({sc-spring-boot-actuator}/autoconfigure/InfoContributorProperties.{sc-ext}[InfoContributorProperties])
|
||||
management.info.build.enabled=true # Enable build info.
|
||||
management.info.build.mode=simple # Mode to use to expose build information.
|
||||
management.info.defaults.enabled=true # Enable default info contributors.
|
||||
|
|
|
@ -94,18 +94,18 @@ public class ImageBanner implements Banner {
|
|||
PropertyResolver properties = new RelaxedPropertyResolver(environment,
|
||||
"banner.image.");
|
||||
int width = properties.getProperty("width", Integer.class, 76);
|
||||
int heigth = properties.getProperty("height", Integer.class, 0);
|
||||
int height = properties.getProperty("height", Integer.class, 0);
|
||||
int margin = properties.getProperty("margin", Integer.class, 2);
|
||||
boolean invert = properties.getProperty("invert", Boolean.class, false);
|
||||
BufferedImage image = readImage(width, heigth);
|
||||
BufferedImage image = readImage(width, height);
|
||||
printBanner(image, margin, invert, out);
|
||||
}
|
||||
|
||||
private BufferedImage readImage(int width, int heigth) throws IOException {
|
||||
private BufferedImage readImage(int width, int height) throws IOException {
|
||||
InputStream inputStream = this.image.getInputStream();
|
||||
try {
|
||||
BufferedImage image = ImageIO.read(inputStream);
|
||||
return resizeImage(image, width, heigth);
|
||||
return resizeImage(image, width, height);
|
||||
}
|
||||
finally {
|
||||
inputStream.close();
|
||||
|
|
|
@ -157,7 +157,7 @@ public class ImageBannerTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void printBannerWhenHasMarginPropertShouldPrintSizedMargin() throws Exception {
|
||||
public void printBannerWhenHasMarginPropertyShouldPrintSizedMargin() throws Exception {
|
||||
AnsiOutput.setEnabled(AnsiOutput.Enabled.NEVER);
|
||||
String banner = printBanner("large.gif", "banner.image.margin=4");
|
||||
String[] lines = banner.split(NEW_LINE);
|
||||
|
|
|
@ -1129,7 +1129,7 @@ public class SpringApplicationTests {
|
|||
@Override
|
||||
public Resource getResource(String path) {
|
||||
Resource resource = this.resources.get(path);
|
||||
return (resource == null ? new ClassPathResource("doesnotexit") : resource);
|
||||
return (resource == null ? new ClassPathResource("doesnotexist") : resource);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue