注释类型 AutoConfigureRestDocs
@Target(TYPE) @Retention(RUNTIME) @Documented @Inherited @ImportAutoConfiguration @Import(org.springframework.boot.test.autoconfigure.restdocs.RestDocumentationContextProviderRegistrar.class) @PropertyMapping("spring.test.restdocs") public @interface AutoConfigureRestDocs
Annotation that can be applied to a test class to enable and configure auto-configuration of Spring REST Docs. Allows configuration of the output directory and the host, scheme, and port of generated URIs. When further configuration is required aRestDocsMockMvcConfigurationCustomizer
bean can be used.- 从以下版本开始:
- 1.4.0
- 另请参阅:
RestDocsAutoConfiguration
,RestDocsMockMvcConfigurationCustomizer
可选元素概要
可选元素 修饰符和类型 可选元素 说明 String
outputDir
The output directory to which generated snippets will be written.String
uriHost
The host to be used in documented URIs.int
uriPort
The port to be used in documented URIs.String
uriScheme
The scheme (typicallyhttp
orhttps
) to be used in documented URIs.String
value
The output directory to which generated snippets will be written.
元素详细资料
value
@AliasFor("outputDir") String value
The output directory to which generated snippets will be written. An alias foroutputDir()
.- 返回:
- the output directory
- 默认值:
- ""
uriPort
int uriPort
The port to be used in documented URIs. Defaults to8080
.- 返回:
- the port
- 默认值:
- 8080