open class SpringExtension : BeforeAllCallback, AfterAllCallback, TestInstancePostProcessor, BeforeEachCallback, AfterEachCallback, BeforeTestExecutionCallback, AfterTestExecutionCallback, ParameterResolver
SpringExtension
integrates the Spring TestContext Framework into JUnit 5's Jupiter programming model.
To use this extension, simply annotate a JUnit Jupiter based test class with @ExtendWith(SpringExtension.class)
, @SpringJUnitConfig
, or @SpringJUnitWebConfig
.
Author
Sam Brannen
Since
5.0
See Also
org.springframework.test.context.junit.jupiter.EnabledIforg.springframework.test.context.junit.jupiter.DisabledIforg.springframework.test.context.junit.jupiter.SpringJUnitConfigorg.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfigorg.springframework.test.context.TestContextManager
SpringExtension()
To use this extension, simply annotate a JUnit Jupiter based test class with |
open fun afterAll(context: ExtensionContext): Unit
Delegates to |
|
open fun afterEach(context: ExtensionContext): Unit
Delegates to |
|
open fun afterTestExecution(context: ExtensionContext): Unit
Delegates to |
|
open fun beforeAll(context: ExtensionContext): Unit
Delegates to |
|
open fun beforeEach(context: ExtensionContext): Unit
Delegates to |
|
open fun beforeTestExecution(context: ExtensionContext): Unit
Delegates to |
|
open static fun getApplicationContext(context: ExtensionContext): ApplicationContext
Get the ApplicationContext associated with the supplied |
|
open fun postProcessTestInstance(testInstance: Any, context: ExtensionContext): Unit
Delegates to |
|
open fun resolveParameter(parameterContext: ParameterContext, extensionContext: ExtensionContext): Any
Resolve a value for the Parameter in the supplied ParameterContext by retrieving the corresponding dependency from the test's ApplicationContext. Delegates to |
|
open fun supportsParameter(parameterContext: ParameterContext, extensionContext: ExtensionContext): Boolean
Determine if the value for the Parameter in the supplied ParameterContext should be autowired from the test's ApplicationContext. Returns WARNING: If the parameter is declared in a |