Annotation Type 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. If multiple
RestTemplates are in use, inject
MockServerRestTemplateCustomizer and use
getServer(RestTemplate) or bind a MockRestServiceServer directly.- Since:
- 1.4.0
- Author:
- Phillip Webb
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanIfMockServerRestTemplateCustomizershould be enabled andMockRestServiceServerbeans should be registered.
-
Element Details
-
enabled
boolean enabledIfMockServerRestTemplateCustomizershould be enabled andMockRestServiceServerbeans should be registered. Defaults totrue- Returns:
- if mock support is enabled
- Default:
- true
-