From d9828a0aaa3b81db50e63b2b2eee9189d340b6cb Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Mon, 27 Nov 2017 04:43:02 +0900 Subject: [PATCH] Polish See gh-11143 --- ...seReactiveRepositoriesAutoConfigurationTests.java | 2 +- .../src/main/asciidoc/spring-boot-features.adoc | 12 ++++++------ .../pom.xml | 2 +- .../test/autoconfigure/web/reactive/WebFluxTest.java | 2 +- .../test/autoconfigure/web/servlet/WebMvcTest.java | 2 +- .../web/reactive/webclient/ExampleController2.java | 2 +- .../web/reactive/webclient/ExampleIdConverter.java | 3 +-- .../web/servlet/mockmvc/ExampleController2.java | 4 ++-- .../autoconfigure/web/servlet/mockmvc/ExampleId.java | 4 ++-- 9 files changed, 16 insertions(+), 17 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/couchbase/CouchbaseReactiveRepositoriesAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/couchbase/CouchbaseReactiveRepositoriesAutoConfigurationTests.java index e32fd3aaea9..c799c056a61 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/couchbase/CouchbaseReactiveRepositoriesAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/couchbase/CouchbaseReactiveRepositoriesAutoConfigurationTests.java @@ -80,7 +80,7 @@ public class CouchbaseReactiveRepositoriesAutoConfigurationTests { @Test public void doesNotTriggerDefaultRepositoryDetectionIfCustomized() { - load(CouchbaseReactiveRepositoriesAutoConfigurationTests.CustomizedConfiguration.class); + load(CustomizedConfiguration.class); assertThat(this.context.getBeansOfType(ReactiveCityCouchbaseRepository.class)) .isEmpty(); } 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 31937225317..d42572c3681 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 @@ -4568,12 +4568,12 @@ This sample configuration reuses the `Cluster` that was created via auto-configu If Redis is available and configured, a `RedisCacheManager` is auto-configured. It is possible to create additional caches on startup by setting the `spring.cache.cache-names` property and cache defaults can be configured using -`spring.redis.cache.*` properties. For instance, the following configuration creates +`spring.cache.redis.*` properties. For instance, the following configuration creates `cache1` and `cache2` caches with a _time to live_ of 10 minutes: [source,properties,indent=0] ---- - spring.cache.cache-names=cache1,cache2 + spring.cache.cache-names=cache1,cache2 spring.cache.redis.time-to-live=600000 ---- @@ -4603,7 +4603,7 @@ maximum size of 500 and a _time to live_ of 10 minutes [source,properties,indent=0] ---- - spring.cache.cache-names=cache1,cache2 + spring.cache.cache-names=cache1,cache2 spring.cache.caffeine.spec=maximumSize=500,expireAfterAccess=600s ---- @@ -4625,7 +4625,7 @@ as follows: [source,properties,indent=0] ---- - spring.cache.cache-names=cache1,cache2 + spring.cache.cache-names=cache1,cache2 ---- If you do so and your application uses a cache not listed, then it fails at runtime when @@ -6017,7 +6017,7 @@ A list of the auto-configuration that is enabled by `@JsonTest` can be ==== Auto-configured Spring MVC Tests To test Spring MVC controllers are working as expected, you can use the `@WebMvcTest` annotation. `@WebMvcTest` auto-configures the Spring MVC infrastructure and limits -scanned beans to `@Controller`, `@ControllerAdvice`, `@JsonComponent`, `@Converter`, +scanned beans to `@Controller`, `@ControllerAdvice`, `@JsonComponent`, `Converter`, `GenericConverter`, `Filter`, `WebMvcConfigurer`, and `HandlerMethodArgumentResolver`. Regular `@Component` beans are not scanned when using this annotation. @@ -6124,7 +6124,7 @@ A list of the auto-configuration settings that are enabled by `@WebMvcTest` can To test that Spring WebFlux controllers are working as expected, you can use the `@WebFluxTest` annotation. `@WebFluxTest` auto-configures the Spring WebFlux infrastructure and limits scanned beans to `@Controller`, `@ControllerAdvice`, -`@JsonComponent`, `Converter`, and `WebFluxConfigurer`. Regular `@Component` beans are +`@JsonComponent`, `Converter`, `GenericConverter`, and `WebFluxConfigurer`. Regular `@Component` beans are not scanned when the `@WebFluxTest` annotation is used. TIP: If you need to register extra components such as Jackson `Module`, you can import diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase-reactive/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase-reactive/pom.xml index 34c28d7ae41..61cb6e443ef 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase-reactive/pom.xml +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase-reactive/pom.xml @@ -3,8 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - spring-boot-starters org.springframework.boot + spring-boot-starters ${revision} spring-boot-starter-data-couchbase-reactive diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java index 888612db3fc..a3bf462c434 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java @@ -43,7 +43,7 @@ import org.springframework.test.web.reactive.server.WebTestClient; *

* Using this annotation will disable full auto-configuration and instead apply only * configuration relevant to WebFlux tests (i.e. {@code @Controller}, - * {@code @ControllerAdvice}, {@code @JsonComponent}, {@code Converter}, and + * {@code @ControllerAdvice}, {@code @JsonComponent}, {@code Converter}/{@code GenericConverter}, and * {@code WebFluxConfigurer} beans but not {@code @Component}, {@code @Service} or * {@code @Repository} beans). *

diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java index 0ef95d4de86..171d13f54c0 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java @@ -43,7 +43,7 @@ import org.springframework.test.web.servlet.MockMvc; *

* Using this annotation will disable full auto-configuration and instead apply only * configuration relevant to MVC tests (i.e. {@code @Controller}, - * {@code @ControllerAdvice}, {@code @JsonComponent}, {@code Converter}, {@code Filter}, + * {@code @ControllerAdvice}, {@code @JsonComponent}, {@code Converter}/{@code GenericConverter}, {@code Filter}, * {@code WebMvcConfigurer} and {@code HandlerMethodArgumentResolver} beans but not * {@code @Component}, {@code @Service} or {@code @Repository} beans). *

diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/ExampleController2.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/ExampleController2.java index e31952a97df..11696d54145 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/ExampleController2.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/ExampleController2.java @@ -38,7 +38,7 @@ public class ExampleController2 { } @GetMapping("/two/{id}") - public Mono one(@PathVariable ExampleId id) { + public Mono two(@PathVariable ExampleId id) { return Mono.just(id.getId() + "two"); } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/ExampleIdConverter.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/ExampleIdConverter.java index dc4b2670af7..9cc7ad7a500 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/ExampleIdConverter.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/ExampleIdConverter.java @@ -22,13 +22,12 @@ import java.util.UUID; import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; import org.springframework.core.convert.TypeDescriptor; -import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.GenericConverter; import org.springframework.lang.Nullable; import org.springframework.stereotype.Component; /** - * Example {@link Converter} used with {@link WebFluxTest} tests. + * Example {@link GenericConverter} used with {@link WebFluxTest} tests. * * @author Stephane Nicoll */ diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/ExampleController2.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/ExampleController2.java index c33684330b5..68a5032cd1b 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/ExampleController2.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/ExampleController2.java @@ -32,13 +32,13 @@ public class ExampleController2 { @GetMapping("/two") @ResponseBody - public String one(ExampleArgument argument) { + public String two(ExampleArgument argument) { return argument + "two"; } @GetMapping("/two/{id}") @ResponseBody - public String one(@PathVariable ExampleId id) { + public String two(@PathVariable ExampleId id) { return id.getId() + "two"; } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/ExampleId.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/ExampleId.java index c054ebe1bf0..01f1a2f1780 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/ExampleId.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/ExampleId.java @@ -18,10 +18,10 @@ package org.springframework.boot.test.autoconfigure.web.servlet.mockmvc; import java.util.UUID; -import org.springframework.core.convert.converter.Converter; +import org.springframework.core.convert.converter.GenericConverter; /** - * An example attribute that requires a {@link Converter}. + * An example attribute that requires a {@link GenericConverter}. * * @author Stephane Nicoll */