Package org.springframework.restdocs
Class JUnitRestDocumentation
java.lang.Object
org.springframework.restdocs.JUnitRestDocumentation
- All Implemented Interfaces:
org.junit.rules.TestRule,RestDocumentationContextProvider
public class JUnitRestDocumentation
extends Object
implements RestDocumentationContextProvider, org.junit.rules.TestRule
A JUnit
TestRule used to automatically manage the
RestDocumentationContext.- Since:
- 1.1.0
- Author:
- Andy Wilkinson
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newJUnitRestDocumentationinstance that will generate snippets to <gradle/maven build path>/generated-snippet.JUnitRestDocumentation(String outputDirectory) Creates a newJUnitRestDocumentationinstance that will generate snippets to the givenoutputDirectory. -
Method Summary
Modifier and TypeMethodDescriptionorg.junit.runners.model.Statementapply(org.junit.runners.model.Statement base, org.junit.runner.Description description) Returns aRestDocumentationContextfor the operation that is about to be performed.
-
Constructor Details
-
JUnitRestDocumentation
public JUnitRestDocumentation()Creates a newJUnitRestDocumentationinstance that will generate snippets to <gradle/maven build path>/generated-snippet. -
JUnitRestDocumentation
Creates a newJUnitRestDocumentationinstance that will generate snippets to the givenoutputDirectory.- Parameters:
outputDirectory- the output directory
-
-
Method Details
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description) - Specified by:
applyin interfaceorg.junit.rules.TestRule
-
beforeOperation
Description copied from interface:RestDocumentationContextProviderReturns aRestDocumentationContextfor the operation that is about to be performed.- Specified by:
beforeOperationin interfaceRestDocumentationContextProvider- Returns:
- the context for the operation
-