Skip to content

Commit

Permalink
Restore spring.main.disable_banner=fase support
Browse files Browse the repository at this point in the history
  • Loading branch information
philwebb committed Nov 13, 2014
1 parent 90d25bd commit 4840d2c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,12 @@ public ConfigurableApplicationContext run(String... args) {
// 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ public void disableBanner() throws Exception {
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 {
Expand Down

0 comments on commit 4840d2c

Please sign in to comment.