spring-framework / org.springframework.test.context.junit4.rules / SpringClassRule / apply

apply

open fun apply(base: Statement, description: Description): Statement

Apply class-level features of the Spring TestContext Framework to the supplied base statement.

Specifically, this method retrieves the TestContextManager used by this rule and its associated SpringMethodRule and invokes the beforeTestClass() and afterTestClass() methods on the TestContextManager.

In addition, this method checks whether the test is enabled in the current execution environment. This prevents classes with a non-matching @IfProfileValue annotation from running altogether, even skipping the execution of beforeTestClass() methods in TestExecutionListeners.

Parameters

base - the base Statement that this rule should be applied to

description - a Description of the current test execution

Return
a statement that wraps the supplied base with class-level features of the Spring TestContext Framework

See Also
#getTestContextManager#withBeforeTestClassCallbacks#withAfterTestClassCallbacks#withProfileValueCheck#withTestContextManagerCacheEviction