parent
ac22225b1d
commit
d9828a0aaa
|
@ -80,7 +80,7 @@ public class CouchbaseReactiveRepositoriesAutoConfigurationTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void doesNotTriggerDefaultRepositoryDetectionIfCustomized() {
|
public void doesNotTriggerDefaultRepositoryDetectionIfCustomized() {
|
||||||
load(CouchbaseReactiveRepositoriesAutoConfigurationTests.CustomizedConfiguration.class);
|
load(CustomizedConfiguration.class);
|
||||||
assertThat(this.context.getBeansOfType(ReactiveCityCouchbaseRepository.class))
|
assertThat(this.context.getBeansOfType(ReactiveCityCouchbaseRepository.class))
|
||||||
.isEmpty();
|
.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4568,7 +4568,7 @@ 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
|
If Redis is available and configured, a `RedisCacheManager` is auto-configured. It is
|
||||||
possible to create additional caches on startup by setting the
|
possible to create additional caches on startup by setting the
|
||||||
`spring.cache.cache-names` property and cache defaults can be configured using
|
`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:
|
`cache1` and `cache2` caches with a _time to live_ of 10 minutes:
|
||||||
|
|
||||||
[source,properties,indent=0]
|
[source,properties,indent=0]
|
||||||
|
@ -6017,7 +6017,7 @@ A list of the auto-configuration that is enabled by `@JsonTest` can be
|
||||||
==== Auto-configured Spring MVC Tests
|
==== Auto-configured Spring MVC Tests
|
||||||
To test Spring MVC controllers are working as expected, you can use the `@WebMvcTest`
|
To test Spring MVC controllers are working as expected, you can use the `@WebMvcTest`
|
||||||
annotation. `@WebMvcTest` auto-configures the Spring MVC infrastructure and limits
|
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`
|
`Filter`, `WebMvcConfigurer`, and `HandlerMethodArgumentResolver`. Regular `@Component`
|
||||||
beans are not scanned when using this annotation.
|
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
|
To test that Spring WebFlux controllers are working as expected, you can use the
|
||||||
`@WebFluxTest` annotation. `@WebFluxTest` auto-configures the Spring WebFlux
|
`@WebFluxTest` annotation. `@WebFluxTest` auto-configures the Spring WebFlux
|
||||||
infrastructure and limits scanned beans to `@Controller`, `@ControllerAdvice`,
|
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.
|
not scanned when the `@WebFluxTest` annotation is used.
|
||||||
|
|
||||||
TIP: If you need to register extra components such as Jackson `Module`, you can import
|
TIP: If you need to register extra components such as Jackson `Module`, you can import
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>spring-boot-starters</artifactId>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starters</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>spring-boot-starter-data-couchbase-reactive</artifactId>
|
<artifactId>spring-boot-starter-data-couchbase-reactive</artifactId>
|
||||||
|
|
|
@ -43,7 +43,7 @@ import org.springframework.test.web.reactive.server.WebTestClient;
|
||||||
* <p>
|
* <p>
|
||||||
* Using this annotation will disable full auto-configuration and instead apply only
|
* Using this annotation will disable full auto-configuration and instead apply only
|
||||||
* configuration relevant to WebFlux tests (i.e. {@code @Controller},
|
* 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 WebFluxConfigurer} beans but not {@code @Component}, {@code @Service} or
|
||||||
* {@code @Repository} beans).
|
* {@code @Repository} beans).
|
||||||
* <p>
|
* <p>
|
||||||
|
|
|
@ -43,7 +43,7 @@ import org.springframework.test.web.servlet.MockMvc;
|
||||||
* <p>
|
* <p>
|
||||||
* Using this annotation will disable full auto-configuration and instead apply only
|
* Using this annotation will disable full auto-configuration and instead apply only
|
||||||
* configuration relevant to MVC tests (i.e. {@code @Controller},
|
* 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 WebMvcConfigurer} and {@code HandlerMethodArgumentResolver} beans but not
|
||||||
* {@code @Component}, {@code @Service} or {@code @Repository} beans).
|
* {@code @Component}, {@code @Service} or {@code @Repository} beans).
|
||||||
* <p>
|
* <p>
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class ExampleController2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/two/{id}")
|
@GetMapping("/two/{id}")
|
||||||
public Mono<String> one(@PathVariable ExampleId id) {
|
public Mono<String> two(@PathVariable ExampleId id) {
|
||||||
return Mono.just(id.getId() + "two");
|
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.boot.test.autoconfigure.web.reactive.WebFluxTest;
|
||||||
import org.springframework.core.convert.TypeDescriptor;
|
import org.springframework.core.convert.TypeDescriptor;
|
||||||
import org.springframework.core.convert.converter.Converter;
|
|
||||||
import org.springframework.core.convert.converter.GenericConverter;
|
import org.springframework.core.convert.converter.GenericConverter;
|
||||||
import org.springframework.lang.Nullable;
|
import org.springframework.lang.Nullable;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Example {@link Converter} used with {@link WebFluxTest} tests.
|
* Example {@link GenericConverter} used with {@link WebFluxTest} tests.
|
||||||
*
|
*
|
||||||
* @author Stephane Nicoll
|
* @author Stephane Nicoll
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -32,13 +32,13 @@ public class ExampleController2 {
|
||||||
|
|
||||||
@GetMapping("/two")
|
@GetMapping("/two")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public String one(ExampleArgument argument) {
|
public String two(ExampleArgument argument) {
|
||||||
return argument + "two";
|
return argument + "two";
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/two/{id}")
|
@GetMapping("/two/{id}")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public String one(@PathVariable ExampleId id) {
|
public String two(@PathVariable ExampleId id) {
|
||||||
return id.getId() + "two";
|
return id.getId() + "two";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,10 @@ package org.springframework.boot.test.autoconfigure.web.servlet.mockmvc;
|
||||||
|
|
||||||
import java.util.UUID;
|
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
|
* @author Stephane Nicoll
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue