Restore spring.main.disable_banner=fase support

Fixes gh-1918
This commit is contained in:
Phillip Webb
2014-11-13 13:48:34 -08:00
parent 90d25bd582
commit 4840d2c88c
2 changed files with 11 additions and 3 deletions

View File

@@ -282,12 +282,12 @@ public class SpringApplication {
// Create and configure the environment
ConfigurableEnvironment environment = getOrCreateEnvironment();
configureEnvironment(environment, args);
if (this.showBanner) {
printBanner(environment);
}
for (SpringApplicationRunListener runListener : runListeners) {
runListener.environmentPrepared(environment);
}
if (this.showBanner) {
printBanner(environment);
}
// Create, load, refresh and run the ApplicationContext
context = createApplicationContext();

View File

@@ -156,6 +156,14 @@ public class SpringApplicationTests {
verify(application, never()).printBanner((Environment) anyObject());
}
@Test
public void disableBannerViaProperty() throws Exception {
SpringApplication application = spy(new SpringApplication(ExampleConfig.class));
application.setWebEnvironment(false);
application.run("--spring.main.show_banner=false");
verify(application, never()).printBanner((Environment) anyObject());
}
@Test
@SuppressWarnings("deprecation")
public void customBanner() throws Exception {