Class RestDocsTestExecutionListener
java.lang.Object
org.springframework.test.context.support.AbstractTestExecutionListener
org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener
- All Implemented Interfaces:
org.springframework.core.Ordered
,org.springframework.test.context.TestExecutionListener
public class RestDocsTestExecutionListener
extends org.springframework.test.context.support.AbstractTestExecutionListener
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
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterTestMethod
(org.springframework.test.context.TestContext testContext) void
beforeTestMethod
(org.springframework.test.context.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 interfaceorg.springframework.core.Ordered
- Overrides:
getOrder
in classorg.springframework.test.context.support.AbstractTestExecutionListener
-
beforeTestMethod
public void beforeTestMethod(org.springframework.test.context.TestContext testContext) throws Exception - Specified by:
beforeTestMethod
in interfaceorg.springframework.test.context.TestExecutionListener
- Overrides:
beforeTestMethod
in classorg.springframework.test.context.support.AbstractTestExecutionListener
- Throws:
Exception
-
afterTestMethod
public void afterTestMethod(org.springframework.test.context.TestContext testContext) throws Exception - Specified by:
afterTestMethod
in interfaceorg.springframework.test.context.TestExecutionListener
- Overrides:
afterTestMethod
in classorg.springframework.test.context.support.AbstractTestExecutionListener
- Throws:
Exception
-