批注接口 AutoConfigureMockRestServiceServer
@Target(TYPE)
@Retention(RUNTIME)
@Documented
@Inherited
@ImportAutoConfiguration
@PropertyMapping("spring.test.webclient.mockrestserviceserver")
public @interface AutoConfigureMockRestServiceServer
Annotation that can be applied to a test class to enable and configure
auto-configuration of a single
MockRestServiceServer
. Only useful when a single
call is made to RestTemplateBuilder
or RestClient.Builder
. If
multiple RestTemplates
or
RestClients
are in use, inject a
MockServerRestTemplateCustomizer
and use
getServer(RestTemplate)
, or inject a MockServerRestClientCustomizer
and use
* getServer(RestClient.Builder)
, or bind a MockRestServiceServer
directly.- 从以下版本开始:
- 1.4.0
- 作者:
- Phillip Webb, Scott Frederick
- 另请参阅:
-
可选元素概要
可选元素修饰符和类型可选元素说明boolean
IfMockServerRestTemplateCustomizer
andMockServerRestClientCustomizer
should be enabled andMockRestServiceServer
beans should be registered.
-
元素详细资料
-
enabled
boolean enabledIfMockServerRestTemplateCustomizer
andMockServerRestClientCustomizer
should be enabled andMockRestServiceServer
beans should be registered. Defaults totrue
- 返回:
- if mock support is enabled
- 默认值:
true
-