Package org.springframework.restdocs
Class RestDocumentationExtension
java.lang.Object
org.springframework.restdocs.RestDocumentationExtension
- All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterEachCallback
,org.junit.jupiter.api.extension.BeforeEachCallback
,org.junit.jupiter.api.extension.Extension
,org.junit.jupiter.api.extension.ParameterResolver
public class RestDocumentationExtension
extends Object
implements org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.ParameterResolver
A JUnit Jupiter
Extension
used to automatically manage the
RestDocumentationContext
.- Author:
- Andy Wilkinson
-
Constructor Summary
ConstructorDescriptionCreates a newRestDocumentationExtension
that will use the default output directory.RestDocumentationExtension
(String outputDirectory) Creates a newRestDocumentationExtension
that will use the givenoutputDirectory
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterEach
(org.junit.jupiter.api.extension.ExtensionContext context) void
beforeEach
(org.junit.jupiter.api.extension.ExtensionContext context) resolveParameter
(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext context) boolean
supportsParameter
(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
-
Constructor Details
-
RestDocumentationExtension
public RestDocumentationExtension()Creates a newRestDocumentationExtension
that will use the default output directory. -
RestDocumentationExtension
Creates a newRestDocumentationExtension
that will use the givenoutputDirectory
.- Parameters:
outputDirectory
- snippet output directory- Since:
- 2.0.4
-
-
Method Details
-
beforeEach
- Specified by:
beforeEach
in interfaceorg.junit.jupiter.api.extension.BeforeEachCallback
- Throws:
Exception
-
afterEach
- Specified by:
afterEach
in interfaceorg.junit.jupiter.api.extension.AfterEachCallback
- Throws:
Exception
-
supportsParameter
public boolean supportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) - Specified by:
supportsParameter
in interfaceorg.junit.jupiter.api.extension.ParameterResolver
-
resolveParameter
public Object resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
resolveParameter
in interfaceorg.junit.jupiter.api.extension.ParameterResolver
-