Class RestDocsTestExecutionListener
java.lang.Object
org.springframework.test.context.support.AbstractTestExecutionListener
org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener
- All Implemented Interfaces:
Ordered
,TestExecutionListener
A
TestExecutionListener
for Spring REST Docs that removes the need for a
@Rule
when using JUnit or manual before and after test calls when using TestNG.- Since:
- 1.4.0
- Author:
- Andy Wilkinson
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterTestMethod
(TestContext testContext) void
beforeTestMethod
(TestContext testContext) int
getOrder()
Methods inherited from class org.springframework.test.context.support.AbstractTestExecutionListener
afterTestClass, afterTestExecution, beforeTestClass, beforeTestExecution, prepareTestInstance
-
Constructor Details
-
RestDocsTestExecutionListener
public RestDocsTestExecutionListener()
-
-
Method Details
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceOrdered
- Overrides:
getOrder
in classAbstractTestExecutionListener
-
beforeTestMethod
- Specified by:
beforeTestMethod
in interfaceTestExecutionListener
- Overrides:
beforeTestMethod
in classAbstractTestExecutionListener
- Throws:
Exception
-
afterTestMethod
- Specified by:
afterTestMethod
in interfaceTestExecutionListener
- Overrides:
afterTestMethod
in classAbstractTestExecutionListener
- Throws:
Exception
-