public final class ManualRestDocumentation extends Object implements RestDocumentationContextProvider
ManualRestDocumentation
is used to manually manage the
RestDocumentationContext
. Primarly intended for use with TestNG, but suitable
for use in any environment where manual management of the context is required.
Users of JUnit should use JUnitRestDocumentation
and take advantage of its
Rule-based support for automatic management of the context.
Constructor and Description |
---|
ManualRestDocumentation(String outputDirectory)
Creates a new
ManualRestDocumentation instance that will generate snippets
to the given outputDirectory . |
Modifier and Type | Method and Description |
---|---|
void |
afterTest()
Notification that a test has completed.
|
RestDocumentationContext |
beforeOperation()
Returns a
RestDocumentationContext for the operation that is about to be
performed. |
void |
beforeTest(Class<?> testClass,
String testMethodName)
Notification that a test is about to begin.
|
public ManualRestDocumentation(String outputDirectory)
ManualRestDocumentation
instance that will generate snippets
to the given outputDirectory
.outputDirectory
- the output directorypublic void beforeTest(Class<?> testClass, String testMethodName)
RestDocumentationContext
for the test on the given testClass
with
the given testMethodName
. Must be followed by a call to
afterTest()
once the test has completed.testClass
- the test classtestMethodName
- the name of the test methodIllegalStateException
- if a context has already be createdpublic void afterTest()
RestDocumentationContext
that was previously established by a call to beforeTest(Class, String)
.public RestDocumentationContext beforeOperation()
RestDocumentationContextProvider
RestDocumentationContext
for the operation that is about to be
performed.beforeOperation
in interface RestDocumentationContextProvider