From c05a29952040ad585c25b39b9ff48bfdb47c5089 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Sat, 4 Nov 2017 05:37:09 +0900 Subject: [PATCH] Polish Closes gh-10921 --- .../ReactiveCloudFoundrySecurityServiceTests.java | 5 ----- .../reactive/ReactiveTokenValidatorTests.java | 5 ----- .../http/GsonHttpMessageConvertersConfiguration.java | 2 +- .../HttpMessageConvertersAutoConfigurationTests.java | 2 ++ .../asciidoc/appendix-configuration-metadata.adoc | 2 +- .../src/main/asciidoc/deployment.adoc | 2 +- .../spring-boot-docs/src/main/asciidoc/howto.adoc | 8 ++++---- .../src/main/asciidoc/production-ready-features.adoc | 2 +- .../src/main/asciidoc/spring-boot-features.adoc | 12 ++++++------ .../autoconfigure/json/AutoConfigureJsonTesters.java | 2 +- .../boot/test/mock/mockito/MockBean.java | 2 +- .../boot/test/mock/mockito/SpyBean.java | 2 +- ...NameOnTestFieldForMultipleExistingBeansTests.java | 2 +- .../boot/loader/tools/DefaultLaunchScript.java | 2 +- 14 files changed, 21 insertions(+), 29 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityServiceTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityServiceTests.java index 01eb07cab84..b2a8bbdbd5a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityServiceTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityServiceTests.java @@ -23,9 +23,7 @@ import okhttp3.mockwebserver.MockWebServer; import okhttp3.mockwebserver.RecordedRequest; import org.junit.After; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import reactor.test.StepVerifier; import org.springframework.boot.actuate.autoconfigure.cloudfoundry.AccessLevel; @@ -43,9 +41,6 @@ import static org.assertj.core.api.Assertions.assertThat; */ public class ReactiveCloudFoundrySecurityServiceTests { - @Rule - public ExpectedException thrown = ExpectedException.none(); - private static final String CLOUD_CONTROLLER = "/my-cloud-controller.com"; private static final String CLOUD_CONTROLLER_PERMISSIONS = CLOUD_CONTROLLER diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveTokenValidatorTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveTokenValidatorTests.java index 5b3bdcd3ef5..7cd9ac41597 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveTokenValidatorTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveTokenValidatorTests.java @@ -30,9 +30,7 @@ import java.util.Map; import org.apache.commons.codec.binary.Base64; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import reactor.core.publisher.Mono; @@ -58,9 +56,6 @@ public class ReactiveTokenValidatorTests { private static final Charset UTF_8 = Charset.forName("UTF-8"); - @Rule - public ExpectedException thrown = ExpectedException.none(); - @Mock private ReactiveCloudFoundrySecurityService securityService; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/GsonHttpMessageConvertersConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/GsonHttpMessageConvertersConfiguration.java index dc754cd6941..4e4bb8715ad 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/GsonHttpMessageConvertersConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/GsonHttpMessageConvertersConfiguration.java @@ -82,7 +82,7 @@ class GsonHttpMessageConvertersConfiguration { } @ConditionalOnBean(MappingJackson2HttpMessageConverter.class) - static class JacksonMissing { + static class JacksonAvailable { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfigurationTests.java index be0f33c5cbd..e871d71bcca 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfigurationTests.java @@ -241,6 +241,8 @@ public class HttpMessageConvertersAutoConfigurationTests { .run((context) -> { assertConverterBeanExists(context, GsonHttpMessageConverter.class, "gsonHttpMessageConverter"); + assertConverterBeanRegisteredWithHttpMessageConverters(context, + GsonHttpMessageConverter.class); assertThat(context).doesNotHaveBean(JsonbHttpMessageConverter.class); }); } diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-configuration-metadata.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-configuration-metadata.adoc index fa5c71169f6..0ce9117e245 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-configuration-metadata.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-configuration-metadata.adoc @@ -822,7 +822,7 @@ Consider the following class: } ---- -The preceding example produces metdata information for `server.name`, `server.host.ip`, +The preceding example produces metadata information for `server.name`, `server.host.ip`, and `server.host.port` properties. You can use the `@NestedConfigurationProperty` annotation on a field to indicate that a regular (non-inner) class should be treated as if it were nested. diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/deployment.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/deployment.adoc index e08fbd9bb17..5e7178ef22f 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/deployment.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/deployment.adoc @@ -25,7 +25,7 @@ The buildpack wraps your deployed code in whatever is needed to _start_ your app it might be a JDK and a call to `java`, it might be an embedded web server, or it might be a full-fledged application server. A buildpack is pluggable, but ideally you should be able to get by with as few customizations to it as possible. This reduces the footprint of -unctionality that is not under your control. It minimizes divergence between development +functionality that is not under your control. It minimizes divergence between development and production environments. Ideally, your application, like a Spring Boot executable jar, has everything that it needs diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc index 99aa4c7b329..c22f25b2348 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -206,7 +206,7 @@ the `` element of your `pom.xml`: ---- -You also need to incude the following element inside ``: +You also need to include the following element inside ``: [source,xml,indent=0] ---- @@ -710,7 +710,7 @@ processed early (before the value is actually available). === Configure SSL SSL can be configured declaratively by setting the various `+server.ssl.*+` properties, typically in `application.properties` or `application.yml`. The following example shows -setting SSL properties in `applicaiton.properties`: +setting SSL properties in `application.properties`: [source,properties,indent=0,subs="verbatim,quotes,attributes"] ---- @@ -1591,7 +1591,7 @@ To run an app with that `DataSource`, all you need is the connection information. Pool-specific settings can also be provided. Check the implementation that is going to be used at runtime for more details. -The following example shows how to deine a JDBC data source by setting properties: +The following example shows how to define a JDBC data source by setting properties: [source,properties,indent=0] ---- @@ -1947,7 +1947,7 @@ If you are configuring a component yourself, you can use an `EntityManagerFactoryDependsOnPostProcessor` subclass as a convenient way of setting up the necessary dependencies. For example, if you use Hibernate Search with Elasticsearch as its index manager, any `EntityManagerFactory` beans must be -configured to depend on the `elasticsearchClient` bean, as shown in the follwing example: +configured to depend on the `elasticsearchClient` bean, as shown in the following example: [source,java,indent=0] ---- diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc index 076efde72b1..5976f0e03d5 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc @@ -938,7 +938,7 @@ information: - The request's method - The request's URI (templated if possible). -- The esponse's status. +- The response's status. To customize the tags, use the `defaultTags` method on your `RouterFunctionMetrics` instance. diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 344dea07fc0..d4ed48060e6 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -2137,7 +2137,7 @@ used instead of the `ErrorAttributes` representation. [[boot-features-error-handling-custom-error-pages]] -===== Custom Error Eages +===== Custom Error Pages If you want to display a custom HTML error page for a given status code, you can add a file to an `/error` folder. Error pages can either be static HTML (that is, added under any of the static resource folders) or built by using templates. The name of the file @@ -2777,7 +2777,7 @@ register a Spring bean that implements the `WebServerFactoryCustomizer` interfac `WebServerFactoryCustomizer` provides access to the `ConfigurableServletWebServerFactory`, which includes numerous customization setter methods. Dedicated variants exist for Tomcat, Jetty, and Undertow. The following example -shows programatically setting the port: +shows programmatically setting the port: [source,java,indent=0] ---- @@ -3070,7 +3070,7 @@ Production database connections can also be auto-configured by using a pooling `DataSource`. Spring Boot uses the following algorithm for choosing a specific implementation: -. We prefer HikariCP for its performance and concurrency. If HkiariCP is available, we +. We prefer HikariCP for its performance and concurrency. If HikariCP is available, we always choose it. . Otherwise, if the Tomcat pooling `DataSource` is available, we use it. . If neither HikariCP nor the Tomcat pooling datasource are available and if Commons @@ -6173,7 +6173,7 @@ Spring Data JPA repositories. Regular `@Component` beans are not loaded into the By default, data JPA tests are transactional and roll back at the end of each test. See the {spring-reference}testing.html#testcontext-tx-enabling-transactions[relevant section] -in the Spring Framwork Reference Documentation for more details. If that is not what you +in the Spring Framework Reference Documentation for more details. If that is not what you want, you can disable transaction management for a test or for the whole class as follows: @@ -6438,7 +6438,7 @@ A list of the auto-configuration settings that are enabled by `@DataNeo4jTest` c ==== Auto-configured Data Redis Tests You can use `@DataRedisTest` to test Redis applications. By default, it scans for `@RedisHash` classes and configures Spring Data Redis repositories. Regular `@Component` -beans are not loaded into the `ApplicationContext`. The follwing example shows the +beans are not loaded into the `ApplicationContext`. The following example shows the `@DataRedisTest` annotation in use: [source,java,indent=0] @@ -6510,7 +6510,7 @@ following example: } ---- -A list of the auto-configuration settiongs that are enabled by `@DataLdapTest` can be +A list of the auto-configuration settings that are enabled by `@DataLdapTest` can be <>. diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/AutoConfigureJsonTesters.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/AutoConfigureJsonTesters.java index 3bf8f41f565..7cfe0b59bea 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/AutoConfigureJsonTesters.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/AutoConfigureJsonTesters.java @@ -47,7 +47,7 @@ public @interface AutoConfigureJsonTesters { /** * If {@link BasicJsonTester}, {@link JacksonTester}, {@link JsonbTester} and - * {@link GsonTester} beans should be registered. Defaults to {@code true} + * {@link GsonTester} beans should be registered. Defaults to {@code true}. * @return if tester support is enabled */ boolean enabled() default true; diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBean.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBean.java index 1a323240aad..0700c228920 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBean.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBean.java @@ -41,7 +41,7 @@ import org.springframework.test.context.junit4.SpringRunner; * existing bean is defined a new one will be added. Dependencies that are known to the * application context but are not beans (such as those * {@link org.springframework.beans.factory.config.ConfigurableListableBeanFactory#registerResolvableDependency(Class, Object) - * registered directly} ) will not be found and a mocked bean will be added to the context + * registered directly}) will not be found and a mocked bean will be added to the context * alongside the existing dependency. *

* When {@code @MockBean} is used on a field, as well as being registered in the diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/SpyBean.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/SpyBean.java index 759e179f71a..a4f818e4bcb 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/SpyBean.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/SpyBean.java @@ -41,7 +41,7 @@ import org.springframework.test.context.junit4.SpringRunner; * will be added. Dependencies that are known to the application context but are not beans * (such as those * {@link org.springframework.beans.factory.config.ConfigurableListableBeanFactory#registerResolvableDependency(Class, Object) - * registered directly} ) will not be found and a spied bean will be added to the context + * registered directly}) will not be found and a spied bean will be added to the context * alongside the existing dependency. *

* When {@code @SpyBean} is used on a field, as well as being registered in the diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyBeanWithNameOnTestFieldForMultipleExistingBeansTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyBeanWithNameOnTestFieldForMultipleExistingBeansTests.java index 529d906e867..8ebaa066fdb 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyBeanWithNameOnTestFieldForMultipleExistingBeansTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyBeanWithNameOnTestFieldForMultipleExistingBeansTests.java @@ -44,7 +44,7 @@ public class SpyBeanWithNameOnTestFieldForMultipleExistingBeansTests { @Test public void testSpying() throws Exception { MockingDetails mockingDetails = Mockito.mockingDetails(this.spy); - assertThat(mockingDetails.isMock()).isTrue(); + assertThat(mockingDetails.isSpy()).isTrue(); assertThat(mockingDetails.getMockCreationSettings().getMockName().toString()) .isEqualTo("two"); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/DefaultLaunchScript.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/DefaultLaunchScript.java index 0b92466a037..fc64fd84ca0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/DefaultLaunchScript.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/DefaultLaunchScript.java @@ -104,7 +104,7 @@ public class DefaultLaunchScript implements LaunchScript { if (properties != null && properties.containsKey(name)) { Object propertyValue = properties.get(name); if (FILE_PATH_KEYS.contains(name)) { - value = parseFilePropertyValue(properties.get(name)); + value = parseFilePropertyValue(propertyValue); } else { value = propertyValue.toString();