Merge pull request #11143 from izeye:polish-20171125
* pr/11143: Polish contribution Polish
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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,9 +6017,9 @@ 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`,
|
||||
`Filter`, `WebMvcConfigurer`, and `HandlerMethodArgumentResolver`. Regular `@Component`
|
||||
beans are not scanned when using this annotation.
|
||||
scanned beans to `@Controller`, `@ControllerAdvice`, `@JsonComponent`, `Converter`,
|
||||
`GenericConverter`, `Filter`, `WebMvcConfigurer`, and `HandlerMethodArgumentResolver`.
|
||||
Regular `@Component` beans are not scanned when using this annotation.
|
||||
|
||||
TIP: If you need to register extra components such as Jackson `Module`, you can import
|
||||
additional configuration classes using `@Import` on your test.
|
||||
@@ -6124,8 +6124,8 @@ 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
|
||||
not scanned when the `@WebFluxTest` annotation is used.
|
||||
`@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
|
||||
additional configuration classes using `@Import` on your test.
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>spring-boot-starters</artifactId>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starters</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<artifactId>spring-boot-starter-data-couchbase-reactive</artifactId>
|
||||
|
||||
@@ -43,9 +43,9 @@ import org.springframework.test.web.reactive.server.WebTestClient;
|
||||
* <p>
|
||||
* 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 WebFluxConfigurer} beans but not {@code @Component}, {@code @Service} or
|
||||
* {@code @Repository} beans).
|
||||
* {@code @ControllerAdvice}, {@code @JsonComponent},
|
||||
* {@code Converter}/{@code GenericConverter}, and {@code WebFluxConfigurer} beans but not
|
||||
* {@code @Component}, {@code @Service} or {@code @Repository} beans).
|
||||
* <p>
|
||||
* By default, tests annotated with {@code @WebFluxTest} will also auto-configure a
|
||||
* {@link WebTestClient}. For more fine-grained control of WebTestClient the
|
||||
|
||||
@@ -43,9 +43,10 @@ import org.springframework.test.web.servlet.MockMvc;
|
||||
* <p>
|
||||
* 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 WebMvcConfigurer} and {@code HandlerMethodArgumentResolver} beans but not
|
||||
* {@code @Component}, {@code @Service} or {@code @Repository} beans).
|
||||
* {@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).
|
||||
* <p>
|
||||
* By default, tests annotated with {@code @WebMvcTest} will also auto-configure Spring
|
||||
* Security and {@link MockMvc} (include support for HtmlUnit WebClient and Selenium
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ExampleController2 {
|
||||
}
|
||||
|
||||
@GetMapping("/two/{id}")
|
||||
public Mono<String> one(@PathVariable ExampleId id) {
|
||||
public Mono<String> two(@PathVariable ExampleId id) {
|
||||
return Mono.just(id.getId() + "two");
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user