public abstract class RestDocumentation extends Object
Modifier and Type | Method and Description |
---|---|
static RestDocumentationResultHandler |
document(String outputDir)
Documents the API call to the given
outputDir . |
static RestDocumentationConfigurer |
documentationConfiguration()
Provides access to a
MockMvcConfigurer that can be used to configure the
REST documentation when building a MockMvc instance. |
static ResponseModifier |
modifyResponseTo(ResponsePostProcessor... responsePostProcessors)
Enables the modification of the response in a
MvcResult prior to it being
documented. |
public static RestDocumentationConfigurer documentationConfiguration()
MockMvcConfigurer
that can be used to configure the
REST documentation when building a MockMvc
instance.ConfigurableMockMvcBuilder.apply(MockMvcConfigurer)
public static RestDocumentationResultHandler document(String outputDir)
outputDir
.outputDir
- The directory to which the documentation will be writtenResultHandler
that will produce the documentationMockMvc.perform(org.springframework.test.web.servlet.RequestBuilder)
,
ResultActions.andDo(org.springframework.test.web.servlet.ResultHandler)
public static ResponseModifier modifyResponseTo(ResponsePostProcessor... responsePostProcessors)
MvcResult
prior to it being
documented. The modification is performed using the given
responsePostProcessors
.responsePostProcessors
- the post-processors to use to modify the responseResponsePostProcessors