Restore spring.main.disable_banner=fase support
Fixes gh-1918
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user