Add new WebApplicationType enum to pave the way for Web Flux support
Closes gh-8077
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,6 +23,7 @@ import java.util.List;
|
||||
import org.springframework.boot.Banner;
|
||||
import org.springframework.boot.ResourceBanner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.context.config.AnsiOutputApplicationListener;
|
||||
import org.springframework.boot.context.config.ConfigFileApplicationListener;
|
||||
import org.springframework.boot.devtools.remote.client.RemoteClientConfiguration;
|
||||
@@ -55,7 +56,7 @@ public final class RemoteSpringApplication {
|
||||
Restarter.initialize(args, RestartInitializer.NONE);
|
||||
SpringApplication application = new SpringApplication(
|
||||
RemoteClientConfiguration.class);
|
||||
application.setWebEnvironment(false);
|
||||
application.setWebApplicationType(WebApplicationType.NONE);
|
||||
application.setBanner(getBanner());
|
||||
application.setInitializers(getInitializers());
|
||||
application.setListeners(getListeners());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,6 +24,7 @@ import org.junit.rules.ExpectedException;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@@ -85,7 +86,7 @@ public class RemoteUrlPropertyExtractorTests {
|
||||
|
||||
private ApplicationContext doTest(String... args) {
|
||||
SpringApplication application = new SpringApplication(Config.class);
|
||||
application.setWebEnvironment(false);
|
||||
application.setWebApplicationType(WebApplicationType.NONE);
|
||||
application.addListeners(new RemoteUrlPropertyExtractor());
|
||||
return application.run(args);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -27,6 +27,7 @@ import org.junit.rules.ExpectedException;
|
||||
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.devtools.restart.RestartInitializer;
|
||||
import org.springframework.boot.devtools.restart.Restarter;
|
||||
@@ -63,7 +64,7 @@ public class DevToolPropertiesIntegrationTests {
|
||||
public void classPropertyConditionIsAffectedByDevToolProperties() {
|
||||
SpringApplication application = new SpringApplication(
|
||||
ClassConditionConfiguration.class);
|
||||
application.setWebEnvironment(false);
|
||||
application.setWebApplicationType(WebApplicationType.NONE);
|
||||
this.context = application.run();
|
||||
this.context.getBean(ClassConditionConfiguration.class);
|
||||
}
|
||||
@@ -72,7 +73,7 @@ public class DevToolPropertiesIntegrationTests {
|
||||
public void beanMethodPropertyConditionIsAffectedByDevToolProperties() {
|
||||
SpringApplication application = new SpringApplication(
|
||||
BeanConditionConfiguration.class);
|
||||
application.setWebEnvironment(false);
|
||||
application.setWebApplicationType(WebApplicationType.NONE);
|
||||
this.context = application.run();
|
||||
this.context.getBean(MyBean.class);
|
||||
}
|
||||
@@ -84,7 +85,7 @@ public class DevToolPropertiesIntegrationTests {
|
||||
Restarter.disable();
|
||||
SpringApplication application = new SpringApplication(
|
||||
BeanConditionConfiguration.class);
|
||||
application.setWebEnvironment(false);
|
||||
application.setWebApplicationType(WebApplicationType.NONE);
|
||||
this.context = application.run();
|
||||
this.thrown.expect(NoSuchBeanDefinitionException.class);
|
||||
this.context.getBean(MyBean.class);
|
||||
@@ -97,7 +98,7 @@ public class DevToolPropertiesIntegrationTests {
|
||||
Restarter.disable();
|
||||
SpringApplication application = new SpringApplication(
|
||||
BeanConditionConfiguration.class);
|
||||
application.setWebEnvironment(false);
|
||||
application.setWebApplicationType(WebApplicationType.NONE);
|
||||
application.setDefaultProperties(Collections.<String, Object>singletonMap(
|
||||
"spring.devtools.remote.secret", "donttell"));
|
||||
this.context = application.run();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -54,7 +55,7 @@ public class RestartScopeInitializerTests {
|
||||
|
||||
private ConfigurableApplicationContext runApplication() {
|
||||
SpringApplication application = new SpringApplication(Config.class);
|
||||
application.setWebEnvironment(false);
|
||||
application.setWebApplicationType(WebApplicationType.NONE);
|
||||
return application.run();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user