Commit 4840d2c8 authored by Phillip Webb's avatar Phillip Webb

Restore `spring.main.disable_banner=fase` support

Fixes gh-1918
parent 90d25bd5
......@@ -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();
......
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment