Class ReactorContextTestExecutionListener
java.lang.Object
org.springframework.test.context.support.AbstractTestExecutionListener
org.springframework.security.test.context.support.ReactorContextTestExecutionListener
- All Implemented Interfaces:
org.springframework.core.Ordered
,org.springframework.test.context.TestExecutionListener
public class ReactorContextTestExecutionListener
extends org.springframework.test.context.support.AbstractTestExecutionListener
Sets up the Reactor Context with the Authentication from the TestSecurityContextHolder
and then clears the Reactor Context at the end of the tests.
- Since:
- 5.0
- See Also:
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterTestClass
(org.springframework.test.context.TestContext testContext) void
afterTestExecution
(org.springframework.test.context.TestContext testContext) void
afterTestMethod
(org.springframework.test.context.TestContext testContext) void
beforeTestClass
(org.springframework.test.context.TestContext testContext) void
beforeTestExecution
(org.springframework.test.context.TestContext testContext) void
beforeTestMethod
(org.springframework.test.context.TestContext testContext) int
getOrder()
Returns11000
.void
prepareTestInstance
(org.springframework.test.context.TestContext testContext)
-
Constructor Details
-
ReactorContextTestExecutionListener
public ReactorContextTestExecutionListener()
-
-
Method Details
-
getOrder
public int getOrder()Returns11000
.- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
- Overrides:
getOrder
in classorg.springframework.test.context.support.AbstractTestExecutionListener
-
beforeTestClass
public void beforeTestClass(org.springframework.test.context.TestContext testContext) throws Exception - Specified by:
beforeTestClass
in interfaceorg.springframework.test.context.TestExecutionListener
- Overrides:
beforeTestClass
in classorg.springframework.test.context.support.AbstractTestExecutionListener
- Throws:
Exception
-
prepareTestInstance
public void prepareTestInstance(org.springframework.test.context.TestContext testContext) throws Exception - Specified by:
prepareTestInstance
in interfaceorg.springframework.test.context.TestExecutionListener
- Overrides:
prepareTestInstance
in classorg.springframework.test.context.support.AbstractTestExecutionListener
- Throws:
Exception
-
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
-
beforeTestExecution
public void beforeTestExecution(org.springframework.test.context.TestContext testContext) throws Exception - Specified by:
beforeTestExecution
in interfaceorg.springframework.test.context.TestExecutionListener
- Overrides:
beforeTestExecution
in classorg.springframework.test.context.support.AbstractTestExecutionListener
- Throws:
Exception
-
afterTestExecution
public void afterTestExecution(org.springframework.test.context.TestContext testContext) throws Exception - Specified by:
afterTestExecution
in interfaceorg.springframework.test.context.TestExecutionListener
- Overrides:
afterTestExecution
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
-
afterTestClass
public void afterTestClass(org.springframework.test.context.TestContext testContext) throws Exception - Specified by:
afterTestClass
in interfaceorg.springframework.test.context.TestExecutionListener
- Overrides:
afterTestClass
in classorg.springframework.test.context.support.AbstractTestExecutionListener
- Throws:
Exception
-