public final class ManualRestDocumentation extends java.lang.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()
Creates a new
ManualRestDocumentation instance that will generate snippets
to <gradle/maven build path>/generated-snippet. |
ManualRestDocumentation(java.lang.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(java.lang.Class<?> testClass,
java.lang.String testMethodName)
Notification that a test is about to begin.
|
public ManualRestDocumentation()
ManualRestDocumentation instance that will generate snippets
to <gradle/maven build path>/generated-snippet.public ManualRestDocumentation(java.lang.String outputDirectory)
ManualRestDocumentation instance that will generate snippets
to the given outputDirectory.outputDirectory - the output directorypublic void beforeTest(java.lang.Class<?> testClass,
java.lang.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 methodjava.lang.IllegalStateException - if a context has already be createdpublic void afterTest()
RestDocumentationContext
that was previously established by a call to beforeTest(Class, String).public RestDocumentationContext beforeOperation()
RestDocumentationContextProviderRestDocumentationContext for the operation that is about to be
performed.beforeOperation in interface RestDocumentationContextProvider