Commit 9b153890 authored by Johnny Lim's avatar Johnny Lim Committed by Stephane Nicoll

Polish

Closes gh-9855
parent 75fc0c38
...@@ -1519,7 +1519,7 @@ There is a catch however. Because the actual type of the connection pool is not ...@@ -1519,7 +1519,7 @@ There is a catch however. Because the actual type of the connection pool is not
no keys are generated in the metadata for your custom `DataSource` and no completion is no keys are generated in the metadata for your custom `DataSource` and no completion is
available in your IDE (The `DataSource` interface doesn't expose any property). Also, if available in your IDE (The `DataSource` interface doesn't expose any property). Also, if
you happen to have Hikari on the classpath, this basic setup will not work because Hikari you happen to have Hikari on the classpath, this basic setup will not work because Hikari
has no `url` parameter (but a `jdbcUrl` parameter). You will have to rewrite your has no `url` property (but a `jdbcUrl` property). You will have to rewrite your
configuration as follows: configuration as follows:
[source,properties,indent=0] [source,properties,indent=0]
...@@ -1585,7 +1585,7 @@ described in the previous section. You must, however, mark one of the `DataSourc ...@@ -1585,7 +1585,7 @@ described in the previous section. You must, however, mark one of the `DataSourc
type. type.
If you create your own `DataSource`, the auto-configuration will back off. In the example If you create your own `DataSource`, the auto-configuration will back off. In the example
below, we provide the _exact_ same features set than what the auto-configuration provides below, we provide the _exact_ same features set as what the auto-configuration provides
on the primary data source: on the primary data source:
[source,java,indent=0,subs="verbatim,quotes,attributes"] [source,java,indent=0,subs="verbatim,quotes,attributes"]
...@@ -1618,7 +1618,7 @@ include::{code-examples}/jdbc/CompleteTwoDataSourcesExample.java[tag=configurati ...@@ -1618,7 +1618,7 @@ include::{code-examples}/jdbc/CompleteTwoDataSourcesExample.java[tag=configurati
---- ----
This final example configures two data sources on custom namespaces with the same logic This final example configures two data sources on custom namespaces with the same logic
than what Spring Boot would do in auto-configuration. as what Spring Boot would do in auto-configuration.
......
...@@ -262,14 +262,14 @@ public class SpringApplication { ...@@ -262,14 +262,14 @@ public class SpringApplication {
this.resourceLoader = resourceLoader; this.resourceLoader = resourceLoader;
Assert.notNull(primarySources, "PrimarySources must not be null"); Assert.notNull(primarySources, "PrimarySources must not be null");
this.primarySources = new LinkedHashSet<>(Arrays.asList(primarySources)); this.primarySources = new LinkedHashSet<>(Arrays.asList(primarySources));
this.webApplicationType = deduceWebApplication(); this.webApplicationType = deduceWebApplicationType();
setInitializers((Collection) getSpringFactoriesInstances( setInitializers((Collection) getSpringFactoriesInstances(
ApplicationContextInitializer.class)); ApplicationContextInitializer.class));
setListeners((Collection) getSpringFactoriesInstances(ApplicationListener.class)); setListeners((Collection) getSpringFactoriesInstances(ApplicationListener.class));
this.mainApplicationClass = deduceMainApplicationClass(); this.mainApplicationClass = deduceMainApplicationClass();
} }
private WebApplicationType deduceWebApplication() { private WebApplicationType deduceWebApplicationType() {
if (ClassUtils.isPresent(REACTIVE_WEB_ENVIRONMENT_CLASS, null) if (ClassUtils.isPresent(REACTIVE_WEB_ENVIRONMENT_CLASS, null)
&& !ClassUtils.isPresent(MVC_WEB_ENVIRONMENT_CLASS, null)) { && !ClassUtils.isPresent(MVC_WEB_ENVIRONMENT_CLASS, null)) {
return WebApplicationType.REACTIVE; return WebApplicationType.REACTIVE;
......
...@@ -302,12 +302,12 @@ public class SpringApplicationBuilder { ...@@ -302,12 +302,12 @@ public class SpringApplicationBuilder {
/** /**
* Flag to explicitly request a specific type of web application. Auto-detected based * Flag to explicitly request a specific type of web application. Auto-detected based
* on the classpath if not set. * on the classpath if not set.
* @param webApplication the type of web application * @param webApplicationType the type of web application
* @return the current builder * @return the current builder
* @since 2.0.0 * @since 2.0.0
*/ */
public SpringApplicationBuilder web(WebApplicationType webApplication) { public SpringApplicationBuilder web(WebApplicationType webApplicationType) {
this.application.setWebApplicationType(webApplication); this.application.setWebApplicationType(webApplicationType);
return this; return this;
} }
......
...@@ -763,12 +763,12 @@ public abstract class AbstractServletWebServerFactoryTests { ...@@ -763,12 +763,12 @@ public abstract class AbstractServletWebServerFactoryTests {
} }
@Test @Test
public void compressionOfResposeToGetRequest() throws Exception { public void compressionOfResponseToGetRequest() throws Exception {
assertThat(doTestCompression(10000, null, null)).isTrue(); assertThat(doTestCompression(10000, null, null)).isTrue();
} }
@Test @Test
public void compressionOfResposeToPostRequest() throws Exception { public void compressionOfResponseToPostRequest() throws Exception {
assertThat(doTestCompression(10000, null, null, HttpMethod.POST)).isTrue(); assertThat(doTestCompression(10000, null, null, HttpMethod.POST)).isTrue();
} }
......
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